Arma 3 Scripting

Command in Positions

getTerrainHeight

Also available as Markdown and JSON, or read the original wiki page.

Description

Returns terrain height at the specified location.

Note

Unlike getTerrainHeightASL which returns the exact position's height, this command returns the height at the closest terrain grid pixel to the provided position:

private _cellWidth = getTerrainInfo # 2;
getTerrainHeightASL (_pos apply { _cellWidth * round (_x / _cellWidth) });

Syntax

getTerrainHeight positionWorld

Parameters:

Returns: Number - terrain height

Examples

Example 1

private _gridCellHeight = getTerrainHeight getPosWorld player;

See also

setTerrainHeight · getTerrainHeightASL · getTerrainInfo