Description
Clamps vector values between provided min/max boundaries.
Note
This function can be used to clamp any Array of Numbers (even though it is not its main usage).
Syntax
[vector, min, max] call BIS_fnc_clampVector
Parameters:
vector: Vector3D - (Optional, default [0,0,0]) the vector to be clampedmin: Number - (Optional, default 0)max: Number - (Optional, default 0)
Returns: Vector3D - the clamped vector
Examples
Example 1
private _newVelocity = [velocity vehicle player, -100, 100] call BIS_fnc_clampVector;
vehicle player setVelocity _newVelocity;