Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Mathf.DeltaAngle

Switch to Manual
public static function DeltaAngle(current: float, target: float): float;

Parameters

Description

Calculates the shortest difference between two given angles given in degrees.

	// Prints 90
	Debug.Log(Mathf.DeltaAngle(1080,90));