Vector2.SignedAngle(Vector2 from, Vector2 to)
Returns the signed angle in degrees between from and to.
Parameters:
Name | Type | Description |
---|---|---|
from | Vector2 | The vector from which the angular difference is measured. |
to | Vector2 | The vector to which the angular difference is measured. |
Returns:
type | Description |
---|---|
number | the signed angle in degrees between from and to. |
Usage
---@type Vector2
local from;
---@type Vector2
local to;
local val0 = Vector2:SignedAngle(from, to)
Extra Detail
The angle returned is the signed acute clockwise angle between the two vectors. This means the smaller of the two possible angles between the two vectors is used. The result is never greater than 180 degrees or smaller than -180 degrees.