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:
positionWorld: Position2D or Position3D - world coordinates
Returns: Number - terrain height
Examples
Example 1
private _gridCellHeight = getTerrainHeight getPosWorld player;