{"name":"BIS_fnc_clampVector","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","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","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","params":[{"name":"vector","type":"Vector3D","optional":true,"default":"[0,0,0]","description":"the vector to be clamped","type_expr":"Vector3D","text":"vector: Vector3D - (Optional, default [0,0,0]) the vector to be clamped"},{"name":"min","type":"Number","optional":true,"default":"0","type_expr":"Number","text":"min: Number - (Optional, default 0)"},{"name":"max","type":"Number","optional":true,"default":"0","type_expr":"Number","text":"max: Number - (Optional, default 0)"}],"returns":{"type":"Vector3D","type_expr":"Vector3D","description":"the clamped vector","text":"Vector3D - the clamped *vector*"}}],"examples":[{"code":["private _newVelocity = [velocity vehicle player, -100, 100] call BIS_fnc_clampVector;\nvehicle player setVelocity _newVelocity;"]}],"see_also":["BIS_fnc_clamp","vectorNormalized","vectorMultiply"]}