{"name":"getTerrainHeight","operator":null,"title":"getTerrainHeight","type":"command","url":"https://community.bistudio.com/wiki/getTerrainHeight","revid":377555,"updated":"2026-01-02T06:54:55Z","groups":["Positions"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.10"}],"since":{"game":"arma3","name":"Arma 3","version":"2.10"},"arma3_since":"2.10","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"positionWorld","type":"Position2D or Position3D","optional":false,"default":null,"description":"world coordinates","types":["Position2D","Position3D"],"since":null,"text":"positionWorld: Position2D or Position3D - world coordinates"}],"returns":{"type":"Number","types":["Number"],"description":"terrain height","text":"Number - terrain height"},"form":"unary","operator":null,"left":null,"right":{"text":"positionWorld","types":["Position2D","Position3D"]}}],"examples":[{"text":"```sqf\nprivate _gridCellHeight = getTerrainHeight getPosWorld player;\n```","code":["private _gridCellHeight = getTerrainHeight getPosWorld player;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["setTerrainHeight","getTerrainHeightASL","getTerrainInfo"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Positions","Introduced with Arma 3 version 2.10","Scripting Commands"]}