---
name: "diag_getTerrainHeight"
type: command
status: deprecated
replaced_by: ["getTerrainHeight"]
groups: ["Diagnostic"]
arma3_since: "2.04"
branch: "diag"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/diag_getTerrainHeight
revid: 348945
updated: 2023-11-08T14:45:37Z
---

# diag_getTerrainHeight

*Command · Diagnostic · Arma 3 v2.04 · branch: diag*

> [!WARNING]
> This command is deprecated. Use [getTerrainHeight](../commands/getTerrainHeight.md) instead.

## Description

Returns terrain height at the specified location.

> [!NOTE]
> Unlike [getTerrainHeightASL](../commands/getTerrainHeightASL.md) which  returns the exact position's height, this commands returns the apex of the terrain polygon.

> [!CAUTION]
> This information is **obsolete**. This command is subject to be removed and replaced with: [getTerrainHeight](../commands/getTerrainHeight.md)

## Syntax

```sqf
diag_getTerrainHeight positionWorld
```

**Parameters:**

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

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

## Examples

### Example 1

```sqf
private _h = diag_getTerrainHeight position player;
```

## See also

[diag_setTerrainHeight](../commands/diag_setTerrainHeight.md)

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