Available since Version 1.0.
Clamps the magnitude of a vector to a specified maximum length.
Syntax
Engine.Vector3.ClampMagnitude( vector, maxLength )Arguments
- vector (Vector3): The vector to clamp.
- maxLength (number): The maximum length of the vector.
Return Values
- (Vector3): A vector with its magnitude clamped to the specified maximum length.
Examples
local vector = Engine.Vector3(1, 2, 3)
local maxLength = 2
local result = Engine.Vector3.ClampMagnitude(vector, maxLength)