Skip to main content

Mathf.MoveTowardsAngle(number current, number target, number maxDelta)

Same as MoveTowards but makes sure the values interpolate correctly when they wrap around 360 degrees.

Parameters:

NameTypeDescription
currentnumbercurrent
targetnumbertarget
maxDeltanumbermaxDelta

Returns:

typeDescription
numberMoves value of current towards target.

Usage

---@type number
local current;

---@type number
local target;

---@type number
local maxDelta;


local val0 = Mathf:MoveTowardsAngle(current, target, maxDelta)