{"name":"setCruiseControl","operator":null,"title":"setCruiseControl","type":"command","url":"https://community.bistudio.com/wiki/setCruiseControl","revid":377946,"updated":"2026-01-13T17:58:44Z","groups":["Unit Control","Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.06"}],"since":{"game":"arma3","name":"Arma 3","version":"2.06"},"arma3_since":"2.06","branch":null,"locality":{"argument":"local","effect":"local","server_exec":false},"exec":null,"description":"Limits or sets **local player-controlled** vehicle's speed through cruise control.\n\n> [!NOTE]\n> - this command only works on CarX, TankX, ShipX simulation vehicles\n> - this command is implemented using a PID controller overwriting the vehicle's thrust/brakes input\n\n| Speed Limiter | Cruise Control |\n|---|---|\n| - the vehicle does not accelerate by itself<br>- manually accelerating is required to move forward<br>- accelerating beyond set speed limit is restricted by the PID controller<br>- applying brakes does not disable Speed Limiter<br>- behaviour:<br>  - if the speed is over 120% the set limit, the vehicle will apply 100% of braking and limit acceleration to 0%<br>  - if the speed is below 80% the set limit, the acceleration and braking are untouched<br>  - between 80 and 120%, the PID controller limits the acceleration and applies brakes if required | - the vehicle accelerates by itself<br>- manually accelerating is possible<br>- accelerating above set speed limit is possible<br>- applying brakes disables Cruise Control<br>- behaviour:<br>  - if the speed is over 120% the set limit, the vehicle will apply 100% of braking<br>  - if the speed is below 80% the set limit, the vehicle will apply 100% of acceleration<br>  - between 80 and 120%, the PID controller manages the speed |\n\n> [!IMPORTANT]\n> This command should only be called to *change* values and **not** be called every frame, as it resets the PID controller.","syntaxes":[{"syntax":"vehicle setCruiseControl [speed, autoThrust]","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"the vehicle to limit; local player's vehicle (`vehicle player`)","types":["Object"],"since":null,"text":"vehicle: Object - the vehicle to limit; local player's vehicle (`vehicle player`)"},{"name":"speed","type":"Number","optional":false,"default":null,"description":"desired/top speed in km/h. 0 to disable any setting. Only positives values are valid, negative values will make the vehicle unable to move forward","types":["Number"],"since":null,"text":"speed: Number - desired/top speed in km/h. 0 to disable any setting. Only positives values are valid, negative values will make the vehicle unable to move forward"},{"name":"autoThrust","type":"Boolean","optional":false,"default":null,"description":"Boolean\n- true - Cruise Control: the vehicle will maintain this speed until brakes is applied or driver dies or leaves the vehicle\n- false - Speed Limiter: the vehicle will not accelerate above set speed","types":["Boolean"],"since":null,"text":"autoThrust: Boolean\n- true - Cruise Control: the vehicle will maintain this speed until brakes is applied or driver dies or leaves the vehicle\n- false - Speed Limiter: the vehicle will not accelerate above set speed"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"[speed, autoThrust]","types":["Array"]}}],"examples":[{"text":"```sqf\nvehicle player setCruiseControl [50, true]; // sets cruise control to 50 km/h\n```","code":["vehicle player setCruiseControl [50, true]; // sets cruise control to 50 km/h"]},{"text":"```sqf\nvehicle player setCruiseControl [5, false]; // limits player's vehicle speed to 5 km/h\n```","code":["vehicle player setCruiseControl [5, false]; // limits player's vehicle speed to 5 km/h"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["getCruiseControl","limitSpeed","forceSpeed","setAirplaneThrottle"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Command Group: Unit Control","Introduced with Arma 3 version 2.06","Scripting Commands","Scripting Commands: Local Effect"]}