---
name: "setCruiseControl"
type: command
status: ok
groups: ["Unit Control", "Object Manipulation"]
arma3_since: "2.06"
locality: {"argument": "local", "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/setCruiseControl
revid: 377946
updated: 2026-01-13T17:58:44Z
---

# setCruiseControl

*Command · Unit Control, Object Manipulation · Arma 3 v2.06*

Locality: arguments **local** · effect **local**

## Description

Limits or sets **[local](../commands/local.md) [player](../commands/player.md)-controlled** vehicle's speed through cruise control.

> [!NOTE]
> - this command only works on CarX, TankX, ShipX simulation vehicles
> - this command is implemented using a PID controller overwriting the vehicle's thrust/brakes input

| Speed Limiter | Cruise Control |
|---|---|
| - 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 |

> [!IMPORTANT]
> This command should only be called to *change* values and **not** be called every frame, as it resets the PID controller.

## Syntax

```sqf
vehicle setCruiseControl [speed, autoThrust]
```

**Parameters:**

- `vehicle`: [Object](../topics/Object.md) - the vehicle to limit; [local](../commands/local.md) [player](../commands/player.md)'s vehicle (`vehicle player`)
- `speed`: [Number](../topics/Number.md) - 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
- `autoThrust`: [Boolean](../topics/Boolean.md)
  - [true](../commands/true.md) - Cruise Control: the vehicle will maintain this speed until brakes is applied or driver dies or leaves the vehicle
  - [false](../commands/false.md) - Speed Limiter: the vehicle will not accelerate above set speed

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
vehicle player setCruiseControl [50, true]; // sets cruise control to 50 km/h
```

### Example 2

```sqf
vehicle player setCruiseControl [5, false]; // limits player's vehicle speed to 5 km/h
```

## See also

[getCruiseControl](../commands/getCruiseControl.md) · [limitSpeed](../commands/limitSpeed.md) · [forceSpeed](../commands/forceSpeed.md) · [setAirplaneThrottle](../commands/setAirplaneThrottle.md)

<sub>Source: [BI Community Wiki — setCruiseControl](https://community.bistudio.com/wiki/setCruiseControl) (revision 377946).</sub>
