{"name":"limitSpeed","title":"limitSpeed","type":"command","url":"https://community.bistudio.com/wiki/limitSpeed","revid":379293,"updated":"2026-10-30T23:47:14Z","groups":["Unit Control","Object Manipulation"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","description":"Limit the speed of an AI-driven vehicle or AI person to given value. It has continuous effect and AI will not break through the speed limitation until one is contacted, engaged or regrouped.","syntaxes":[{"syntax":"objectName limitSpeed speed","params":[{"name":"objectName","type":"Object","type_expr":"Object"},{"name":"speed","type":"Number or Arma 3 v2.22 Boolean","description":"in km/h; By default, it's `2 * maxSpeed` of the vehicle/unit (which is defined in config). See Example 1.","type_expr":"Number | Boolean"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"objectName"},"right":{"text":"speed"}}],"examples":[{"text":"```sqf\nleader player limitSpeed 5;        // set to walking speed\nsleep 30;\nleader player limitSpeed (2 * getNumber(configOf leader player >> \"maxSpeed\"));    // remove the limit\n```","code":["leader player limitSpeed 5;\t\t// set to walking speed\nsleep 30;\nleader player limitSpeed (2 * getNumber(configOf leader player >> \"maxSpeed\"));\t// remove the limit"]},{"code":["addMissionEventHandler [\"OnEachFrame\", { hintSilent format [\"myVehicle's speed: %1 km/h\", speed myVehicle toFixed 2] }];\nsleep 5;\nmyVehicle limitSpeed 5;"]},{"text":"```sqf\n// it was necessary to use limitSpeed repeatedly before Arma 3 1.24\n_this setVariable [\"speedLimit\", 50];\n_this spawn {\n    while { sleep 0.1; canMove _this } do\n    {\n        _this limitSpeed (_this getVariable \"speedLimit\");\n    };\n};\nsleep 10;\n_this setVariable [\"speedLimit\", 100]; // update the speed limit\n```","code":["// it was necessary to use limitSpeed repeatedly before Arma 3 1.24\n_this setVariable [\"speedLimit\", 50];\n_this spawn {\n\twhile { sleep 0.1; canMove _this } do\n\t{\n\t\t_this limitSpeed (_this getVariable \"speedLimit\");\n\t};\n};\nsleep 10;\n_this setVariable [\"speedLimit\", 100]; // update the speed limit"]},{"text":"Since Arma 3 2.22:\n\n```sqf\n_heli limitSpeed false; // reset to default\n```","code":["_heli limitSpeed false; // reset to default"]}],"problems":"Since Take On Helicopters v1.00 and as of Arma 3 v2.14, using any negative value on a helicopter will not reset the speed limit, but will force it to fly in reverse.","see_also":["speed","setCruiseControl","forceSpeed"]}