---
name: "buildingPos"
type: command
status: ok
groups: ["Positions"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/buildingPos
revid: 379404
updated: 2026-10-31T00:02:01Z
---

# buildingPos

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

Locality: arguments **global**

## Description

Returns position of a given indexed position in a [building](../topics/Object.md#building).

## Syntax

```sqf
building buildingPos index
```

**Parameters:**

- `building`: [Object](../topics/Object.md)
- `index`: [Number](../topics/Number.md) - index of a specific position

  > [!NOTE]
  > **Arma 3:** Since v1.56 index `-1` will return all available building positions.

**Returns:** [PositionAGL](../topics/Position.md#positionagl) - a single building position. If building position with given index does not exist, `[0, 0, 0]` is returned

> [!NOTE]
> **Arma 3:** Since v1.56 it can also return an [array](../topics/Array.md) of all building positions in format [PositionAGL](../topics/Position.md#positionagl) if index that was given is `-1`.

## Examples

### Example 1

```sqf
_soldier setPosATL (_house1 buildingPos 2);
```

### Example 2

```sqf
_allpositions = nearestBuilding player buildingPos -1;
```

## See also

[nearestBuilding](../commands/nearestBuilding.md) · [nearestObject](../commands/nearestObject.md) · [nearestObjects](../commands/nearestObjects.md) · [nearObjects](../commands/nearObjects.md) · [insideBuilding](../commands/insideBuilding.md) · [buildingExit](../commands/buildingExit.md) · [position](../commands/position.md) · [setPos](../commands/setPos.md) · [setWaypointHousePosition](../commands/setWaypointHousePosition.md) · [waypointHousePosition](../commands/waypointHousePosition.md) · [BIS_fnc_buildingPositions](../functions/BIS_fnc_buildingPositions.md)

## Community notes

**Hardrock** — 2006-08-02

*Notes from before the conversion:*
These examples will move a unit to the 1st position specified in a buildings model, in the second example - bunker1.

```sqf
this move (building buildingPos 1);
this move (bunker1 buildingPos 1);
```

In the default game buildings, the buildingPos is usually right behind a window. This can make it easy to place units in the windows of buildings, by putting the unit near a building and putting this in its init field:

```sqf
this setPosATL ((nearestBuilding this) buildingPos 1);
```

The location returned by buildingPos is not reliable after the player has exited and then resumed the mission. For code that is executed immediately after the mission starts there is no problem.
If buildingPos locations are to be accessed during the mission when the player may have exited and then resumed, save the locations you require at the start of the mission and use these saved locations in your subsequent scripts.

---

**Kronzky** — 2007-01-26

The highest index is *not* necessarily the highest position in a building! Check the z-value to find out the absolute height of a position.

---

**.kju** — 2011-01-08

Almost all buildings loose their building positions when they get (visually) damaged or destroyed. Some debris do still have building positions though. So it is no technical limitation. Just most damaged/destructed buildings models do not (yet?) have building positions. Keep in mind that a damaged or destroyed building is a different object instance (and model).

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