{"name":"setVelocity","operator":null,"title":"setVelocity","type":"command","url":"https://community.bistudio.com/wiki/setVelocity","revid":378408,"updated":"2026-04-04T08:14:56Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.80"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.80"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Sets velocity vector of an object in m/s.\n\n> [!IMPORTANT]\n> Since Arma 3 v2.06 each velocity component is limited to the range +-5000 m/s.","syntaxes":[{"syntax":"object setVelocity vector","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"object: Object"},{"name":"vector","type":"Vector3D","optional":false,"default":null,"description":null,"types":["Vector3D"],"since":null,"text":"vector: Vector3D"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"vector","types":["Vector3D"]}}],"examples":[{"text":"```sqf\n_truck1 setVelocity [20, 0, 0];\n```","code":["_truck1 setVelocity [20, 0, 0];"]},{"text":"Advanced method used for relative acceleration:\n\n```sqf\n_vel = velocity _vehicle;\n_dir = getDir _vehicle;\n_additionalSpeed = 10; // in m/s\n_vehicle setVelocity [\n    (_vel select 0) + (sin _dir * _additionalSpeed), \n    (_vel select 1) + (cos _dir * _additionalSpeed), \n    (_vel select 2) // horizontal only\n];\n```","code":["_vel = velocity _vehicle;\n_dir = getDir _vehicle;\n_additionalSpeed = 10; // in m/s\n_vehicle setVelocity [\n\t(_vel select 0) + (sin _dir * _additionalSpeed), \n\t(_vel select 1) + (cos _dir * _additionalSpeed), \n\t(_vel select 2) // horizontal only\n];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["velocity","velocityModelSpace","setVelocityModelSpace","setVelocityTransformation","speed"],"notes":[{"user":"ffur2007slx2_5","date":"2014-06-20T16:50:00Z","text":"Arma 3 v1.22 setVelocity will be affected by setDir and setVectorDirAndUp, so use it after them."}],"categories":[]}