GetGroundZ
The surface under a point.
The height of the first surface under the point - a ray from half a metre over it, 100 m down: the paving, a bridge, a
roof, an upper storey, wherever the level’s geometry is. Where the geometry has nothing (open terrain), nil: ask
GetTerrainHeight then. Where a spawn, a prop or a teleport should land.
Syntax
Section titled “Syntax”GetGroundZ(x, y, z)| Parameter | Type | |
|---|---|---|
x |
number | metres |
y |
number | metres |
z |
number | metres, the height to look down from |
Returns
Section titled “Returns”the height in metres, or nil when nothing is under the point (or without the geometry)
Example
Section titled “Example”local floor = GetGroundZ(x, y, z) or GetTerrainHeight(x, y) or zSetPlayerPos(pid, x, y, floor)See also
Section titled “See also”GetTerrainHeight · GetNavmeshHeight · RayCast · the The world - clock, weather, terrain, the navmesh, the geometry group of the index
