---
name: "setPos"
type: command
status: ok
groups: ["Positions"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setPos
revid: 377794
updated: 2026-01-03T03:50:30Z
---

# setPos

*Command · Positions · Arma 3 v0.50 · introduced in Operation Flashpoint v1.00*

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

## Description

Sets object position to format [PositionAGLS](../topics/Position.md#positionagls) (over surface). The Z value is used to calculate the nearest surface below the provided position. If the surface is close, it uses the Z position of the surface. Otherwise, Z value becomes the offset from that surface.

> [!IMPORTANT]
> It is recommended to **avoid** this command when placing objects above other objects, due to the unpredictable behavior described above.

## Syntax

```sqf
object setPos pos
```

**Parameters:**

- `object`: [Object](../topics/Object.md)
- `pos`: [PositionAGL](../topics/Position.md#positionagl) or [Position2D](../topics/Position.md#introduction) - if [Position2D](../topics/Position.md#introduction), Z will be set to 0

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

## Examples

### Example 1

```sqf
player setPos [getPos player select 0, getPos player select 1, (getPos player select 2) +10];

// the same as above using set (OFP:R v1.75)
_pos = getPos player;
_pos set [2, _pos select 2 + 10];
player setPos _pos;

// the same as above using modelToWorld (ArmA v1.00)
player setPos (player modelToWorld [0,0,10]);

// the same as above using vectorAdd (Arma 3 v1.22)
player setPos (getPos player vectorAdd [0,0,10]);
```

### Example 2

```sqf
_obj setPos [getPos _obj select 0, getPos _obj select 1, -5];
```

### Example 3

```sqf
player setPos (getPos _obj);
```

## Multiplayer

> [!NOTE]
> **Armed Assault:** ArmA 1.00 to 1.06: this command has local effect, but some simulation types do synchronise their changes over the network whilst others do not.
>
> So far, the only known simulation type that doesn't synchronise its position over the net is "static" ().

## See also

[setPosASL](../commands/setPosASL.md) · [getPos](../commands/getPos.md) · [setVehiclePosition](../commands/setVehiclePosition.md) · [Position](../topics/Position.md)

## Community notes

**Hduregger** — 2011-02-06

Calling [setPos](../commands/setPos.md) on an object can cause the object's orientation to change. This depends on the terrain and/or objects below the object. This was tested by calling [setPos](../commands/setPos.md) on a test object with the position of a helicopter ([modelToWorld](../commands/modelToWorld.md) with some offset). When flying over land the orientation of the test object would rapidly change depending on the slope of the ground and objects beneath it.
Comment applicable to Ver **1.96** and **earlier**:

```sqf
obj1 setPos [x,y,z]
```

Will place most objects z metres above ground level (negative numbers for underground). But if obj1 is a trigger then it will be placed z metres above sea level. This can be very useful if you want to check a unit's height above sea level but it can be a problem if you want to move a trigger to create an explosion or a sound. To move a trigger to a location at ground level:

```sqf
triggername setPos [x,y,0];
triggername setPos [x,y,abs(getPos triggername select 2)];
```

Note for ArmA: Using [setPos](../commands/setPos.md) for a trigger will work in exactly the same way that [setPos](../commands/setPos.md) works for other objects - namely that [setPos](../commands/setPos.md) [x,y,z] will place the trigger z metres above ground level.
[setPos](../commands/setPos.md) for static objects like an ammo crate do not work in MP.

---

**Tankbuster** — 2012-11-23

You can use [getPos](../commands/getPos.md) and [setPos](../commands/setPos.md) on triggers.

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