GetTerrainHeight
The terrain height at a point, from the level’s heightmap.
The server has a heightmap when [validation] heightmap names one the operator exported from the game; without one, or
outside the sampled area, nil. Use it to place things on the ground where a z below 0 is not accepted.
Syntax
Section titled “Syntax”GetTerrainHeight(x, y)| Parameter | Type | |
|---|---|---|
x |
number | metres |
y |
number | metres |
Returns
Section titled “Returns”number - metres; nil without a heightmap or outside it
Example
Section titled “Example”local z = GetTerrainHeight(x, y) or -1CreateProp("barrel_a", x, y, z)See also
Section titled “See also”GetPlayerPos · SetPlayerPos · the The world - clock, weather, terrain, the navmesh, the geometry group of the index
