---
name: "getTerrainHeight"
type: command
status: ok
groups: ["Positions"]
arma3_since: "2.10"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/getTerrainHeight
revid: 377555
updated: 2026-01-02T06:54:55Z
---

# getTerrainHeight

*Command · Positions · Arma 3 v2.10*

## Description

Returns terrain height at the specified location.

> [!NOTE]
> Unlike [getTerrainHeightASL](../commands/getTerrainHeightASL.md) which returns the exact position's height, this command returns the height at the closest terrain grid pixel to the provided position:
>
> ```sqf
> private _cellWidth = getTerrainInfo # 2;
> getTerrainHeightASL (_pos apply { _cellWidth * round (_x / _cellWidth) });
> ```

## Syntax

```sqf
getTerrainHeight positionWorld
```

**Parameters:**

- `positionWorld`: [Position2D](../topics/Position.md#introduction) or [Position3D](../topics/Position.md#introduction) - world coordinates

**Returns:** [Number](../topics/Number.md) - terrain height

## Examples

### Example 1

```sqf
private _gridCellHeight = getTerrainHeight getPosWorld player;
```

## See also

[setTerrainHeight](../commands/setTerrainHeight.md) · [getTerrainHeightASL](../commands/getTerrainHeightASL.md) · [getTerrainInfo](../commands/getTerrainInfo.md)

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