Skip to main content

Vector3.RotateTowards(Vector3 current, Vector3 target, number maxRadiansDelta, number maxMagnitudeDelta)

Rotates a vector current towards target.

Parameters:

NameTypeDescription
currentVector3The vector being managed.
targetVector3The vector.
maxRadiansDeltanumberThe maximum angle in radians allowed for this rotation.
maxMagnitudeDeltanumberThe maximum allowed change in vector magnitude for this rotation.

Returns:

typeDescription
Vector3The location that RotateTowards generates.

Usage

---@type Vector3
local current;

---@type Vector3
local target;

---@type number
local maxRadiansDelta;

---@type number
local maxMagnitudeDelta;


local val0 = Vector3:RotateTowards(current, target, maxRadiansDelta, maxMagnitudeDelta)