{"name":"BIS_fnc_clampVector","operator":null,"title":"BIS fnc clampVector","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_clampVector","revid":327749,"updated":"2022-07-13T11:07:26Z","groups":["Vectors"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Clamps vector values between provided min/max boundaries.\n\n> [!NOTE]\n> This function can be used to clamp any Array of Numbers (even though it is not its main usage).","syntaxes":[{"syntax":"[vector, min, max] call BIS_fnc_clampVector","since":null,"effect":null,"exec":null,"params":[{"name":"vector","type":"Vector3D","optional":true,"default":"[0,0,0]","description":"the vector to be clamped","types":["Vector3D"],"since":null,"text":"vector: Vector3D - (Optional, default [0,0,0]) the vector to be clamped"},{"name":"min","type":"Number","optional":true,"default":"0","description":null,"types":["Number"],"since":null,"text":"min: Number - (Optional, default 0)"},{"name":"max","type":"Number","optional":true,"default":"0","description":null,"types":["Number"],"since":null,"text":"max: Number - (Optional, default 0)"}],"returns":{"type":"Vector3D","types":["Vector3D"],"description":"the clamped vector","text":"Vector3D - the clamped *vector*"}}],"examples":[{"text":"```sqf\nprivate _newVelocity = [velocity vehicle player, -100, 100] call BIS_fnc_clampVector;\nvehicle player setVelocity _newVelocity;\n```","code":["private _newVelocity = [velocity vehicle player, -100, 100] call BIS_fnc_clampVector;\nvehicle player setVelocity _newVelocity;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_clamp","vectorNormalized","vectorMultiply"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Vectors","Functions","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}