Arma 3 Scripting

getTerrainHeight

  • Arma 3 v2.10

Command · Markdown · JSON · 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