---
name: "setVehiclePosition"
type: command
status: ok
groups: ["Positions", "Object Manipulation"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setVehiclePosition
revid: 377535
updated: 2026-01-02T06:53:22Z
---

# setVehiclePosition

*Command · Positions, Object Manipulation · Arma 3 v0.50 · introduced in Operation Flashpoint: Elite v1.00*

Locality: arguments **global** · effect **global**

## Description

Moves the object to a given position (same as [createVehicle](../commands/createVehicle.md) placement algorithm). Uses either the position that's defined by the *position* param, or one of the marker positions from the markers array. The object is placed inside a circle with *position* as its center and *placement* as its radius. The type of placement could also be controlled with *special*.

If position is in water and the vehicle can float, it is placed on water surface, otherwise it is placed on the ground, even if the ground is under water. If roof surfaces support walking, units will be placed on roofs if such position is given.

## Syntax

```sqf
object setVehiclePosition [position, markers, placement, special]
```

**Parameters:**

- `object`: [Object](../topics/Object.md)
- `position`: [PositionATL](../topics/Position.md#positionatl) ([PositionAGL](../topics/Position.md#positionagl) if boat or amphibious), [Position2D](../topics/Position.md#introduction), or [Object](../topics/Object.md) - desired placement position.
  If object is given, object position is used for *position*. Normally only *x* and *y* are considered, unless "CAN_COLLIDE" is used for special placement
- `markers`: [Array](../topics/Array.md) of [String](../topics/String.md)s - if the markers array contains one or more marker names, the position is chosen randomly and could be one of the marker positions or just the supplied main position.
  If marker had z coordinate set with [setMarkerPos](../commands/setMarkerPos.md), the vehicle will be placed on the nearest surface below this z coordinate
- `placement`: [Number](../topics/Number.md) - the vehicle is randomly placed inside a circle with given position as center and placement as its radius
- `special`: [String](../topics/String.md) - (Optional, default "NONE") can be one of the following:
  - `"NONE"` - will look for suitable empty position near given position (subject to other placement params) before placing vehicle there.
  - `"CAN_COLLIDE"` - places vehicle at given position (subject to other placement params), without checking if others objects can cross its 3D model.
  - `"FLY"` - if vehicle is capable of flying and has crew, it will be made airborne at default height.
  If *special* is "" or not specified, default `"NONE"` is used.

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md) on success, [false](../commands/false.md) on failure

## Examples

### Example 1

```sqf
// place the player at either [1000,2000], or one of the three markers positions
player setVehiclePosition [[1000,2000], ["Pos1","Pos2","Pos3"], 0, "CAN_COLLIDE"];
```

### Example 2

```sqf
heli setVehiclePosition [player, [], 0, "FLY"];
```

### Example 3

```sqf
_cam = "camera" camCreate [0,0,0];
_cam setDir random 360;
_cam setVehiclePosition [[5000,5000], [], 1000, "NONE"];
_cam setPosWorld (getPosWorld _cam vectorAdd [0,0,1.8]);
_cam cameraEffect ["Internal", "Back"];
```

### Example 4

```sqf
private _tablePos = player getRelPos [3, 0];
private _table = "Land_CampingTable_F" createVehicle [0,0,0];
private _laptop = "Land_Laptop_unfolded_F" createVehicle [0,0,0];
_table setPos _tablePos;
_laptop setVehiclePosition [_tablePos vectorAdd [0.5, 0.2, 10], [], 0, "CAN_COLLIDE"];
_laptop attachTo [_table];
```

## See also

[setPos](../commands/setPos.md) · [createUnit](../commands/createUnit.md) · [setPosASL](../commands/setPosASL.md) · [setPosWorld](../commands/setPosWorld.md) · [createVehicle](../commands/createVehicle.md) · [Position](../topics/Position.md)

## Community notes

**Killzone_Kid** — 2015-06-24

If you need to set [direction](../commands/direction.md) as well, set it before using [setVehiclePosition](../commands/setVehiclePosition.md). The command will use existing dir of the object for its calculations.

```sqf
player setDir random 360;
player setVehiclePosition [player, [], 100, "none"];
```

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