DeltaAngle(float, float)
Calculates the shortest difference between two angles.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static float DeltaAngle(float current, float target)
Parameters
Returns
Type | Description |
|---|---|
| float | A value between -180 (exclusive) and 180 (inclusive) in degrees |
Examples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // Prints 90 Debug.Log(Mathf.DeltaAngle(1080, 90)); }}