---
name: "setDriveOnPath"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "1.68"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/setDriveOnPath
revid: 347683
updated: 2023-10-10T16:57:57Z
---

# setDriveOnPath

*Command · Object Manipulation · Arma 3 v1.68*

## Description

Sets the path to follow for AI driver. Note that [unitReady](../commands/unitReady.md) will return [true](../commands/true.md) even if AI is still driving through the points.

Using any other *move* command (e.g `_vehicle move getPosATL _vehicle`) or [doStop](../commands/doStop.md) will stop the effect of this command.

> [!IMPORTANT]
> This command does **not** work if the vehicle doesn't have an [AI steering component](../commands/useAISteeringComponent.md) defined in its config, or if the component is disabled. Thus, it never works on air vehicles and boats which don't use steering components. Only land vehicles may be compatible. (cars, tanks, APCs, etc.)

> [!NOTE]
> For the command to work properly, the unit must either be an [agent](../commands/createAgent.md), or in the case of normal AI, have been stopped using [doStop](../commands/doStop.md).

## Syntax

```sqf
vehicleName setDriveOnPath points
```

**Parameters:**

- `vehicleName`: [Object](../topics/Object.md)
- `points`: [Array](../topics/Array.md) - list of [Position](../topics/Position.md)s to format [x,y,z] OR to format [x,y,z, speed], speed being **in m/s**.

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

## Examples

### Example 1

```sqf
myVehicle setDriveOnPath [getMarkerPos "wp1", getMarkerPos "wp2"];
```

### Example 2

```sqf
private _points = allMapMarkers apply { getMarkerPos _x; }; // getting all marker positions
{ _x pushBack 15; } forEach _points; // setting speed
myVehicle setDriveOnPath _points;
```

## See also

[move](../commands/move.md) · [forceSpeed](../commands/forceSpeed.md) · [limitSpeed](../commands/limitSpeed.md) · Waypoint · [useAISteeringComponent](../commands/useAISteeringComponent.md)

## Community notes

**Leopard20** — 2021-06-25

To use this command, the AI must not have a [formLeader](../commands/formLeader.md). The easiest way to achieve this is to use [doStop](../commands/doStop.md) to stop the AI (warning! it'll break the AI waypoints)

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