Skip to content

Api > Vector3 > RotateTowards()


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

Rotates a vector current towards target.

Parameters:⚓︎

Name Type Description
current Vector3 The vector being managed.
target Vector3 The vector.
maxRadiansDelta number The maximum angle in radians allowed for this rotation.
maxMagnitudeDelta number The maximum allowed change in vector magnitude for this rotation.

Returns:⚓︎

type Description
Vector3 The 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)