# getGroundPosition (Client)

> Finds the ground right below a point, up to 1000 m down. Only buildings and objects count.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: World and weather
- **URL**: https://wiki.mymp.gg/en/getGroundPosition

## Syntax

```lua
float|false getGroundPosition(float x, y, z)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `x, y, z` | `float` | The point the search goes down from. A `vec3` also works. |

## Returns

The ground's `z`, or `false` if nothing was found.

## Example

```lua
local pos = getElementPosition(localPlayer)
local groundZ = getGroundPosition(pos.x, pos.y, pos.z + 2)
if groundZ then
    outputDebugString(("%.1f m above the ground"):format(pos.z - groundZ))
end
```

## See also

- [processLineOfSight (Client)](https://wiki.mymp.gg/en/processLineOfSight.md): Casts a ray between two points and returns the first thing it hits.
- [isLineOfSightClear (Client)](https://wiki.mymp.gg/en/isLineOfSightClear.md): Tells whether nothing blocks the segment between two points. Only buildings and objects block it, not vehicles or peds.
