Skip to main content

Vector3.ClampMagnitude(Vector3 vector, number maxLength)

Returns a copy of vector with its magnitude clamped to maxLength.

Parameters:

NameTypeDescription
vectorVector3
maxLengthnumbermax Length

Returns:

typeDescription
Vector3a copy of vector with its magnitude clamped to maxLength.

Usage

---@type Vector3
local vector;

---@type number
local maxLength;


local val0 = Vector3:ClampMagnitude(vector, maxLength)