{"name":"getTerrainHeight","title":"getTerrainHeight","type":"command","url":"https://community.bistudio.com/wiki/getTerrainHeight","revid":377555,"updated":"2026-01-02T06:54:55Z","groups":["Positions"],"status":"ok","games":{"arma3":"2.10"},"since":"arma3 2.10","arma3_since":"2.10","description":"Returns terrain height at the specified location.\n\n> [!NOTE]\n> Unlike getTerrainHeightASL which returns the exact position's height, this command returns the height at the closest terrain grid pixel to the provided position:\n>\n> ```sqf\n> private _cellWidth = getTerrainInfo # 2;\n> getTerrainHeightASL (_pos apply { _cellWidth * round (_x / _cellWidth) });\n> ```","syntaxes":[{"syntax":"getTerrainHeight positionWorld","params":[{"name":"positionWorld","type":"Position2D or Position3D","description":"world coordinates","type_expr":"Position2D | Position3D"}],"returns":{"type":"Number","type_expr":"Number","description":"terrain height"},"form":"unary","right":{"text":"positionWorld"}}],"examples":[{"code":["private _gridCellHeight = getTerrainHeight getPosWorld player;"]}],"see_also":["setTerrainHeight","getTerrainHeightASL","getTerrainInfo"]}