{"name":"limitSpeed","operator":null,"title":"limitSpeed","type":"command","url":"https://community.bistudio.com/wiki/limitSpeed","revid":378640,"updated":"2026-05-15T17:05:16Z","groups":["Unit Control","Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"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":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"objectName","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"objectName: Object"},{"name":"speed","type":"Number (or Boolean since Arma 3 2.22)","optional":false,"default":null,"description":"in km/h; By default, it's `2 * maxSpeed` of the vehicle/unit (which is defined in config). See Example 1.","types":["Number","Boolean"],"since":null,"text":"speed: Number (or Boolean since Arma 3 2.22) - in km/h; By default, it's `2 * maxSpeed` of the vehicle/unit (which is defined in config). See Example 1."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"objectName","types":["Object"]},"right":{"text":"speed","types":["Number","Boolean"]}}],"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"]},{"text":"```sqf\naddMissionEventHandler [\"OnEachFrame\", { hintSilent format [\"myVehicle's speed: %1 km/h\", speed myVehicle toFixed 2] }];\nsleep 5;\nmyVehicle limitSpeed 5;\n```","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"]}],"multiplayer":null,"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.","aliases":[],"see_also":["speed","setCruiseControl","forceSpeed"],"notes":[],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Command Group: Unit Control","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}