# getGroundPosition (Cliente)

> Busca el suelo justo debajo de un punto, hasta 1000 m hacia abajo. Solo cuentan edificios y objetos.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Función Lua
- **Lado**: Cliente
- **Categoría**: Mundo y clima
- **URL**: https://wiki.mymp.gg/es/getGroundPosition

## Sintaxis

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

## Parámetros

| Nombre | Tipo | Descripción |
| --- | --- | --- |
| `x, y, z` | `float` | El punto desde el que baja la búsqueda. También acepta un `vec3`. |

## Retorno

La altura `z` del suelo, o `false` si no se encontró nada.

## Ejemplo

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

## Ver también

- [processLineOfSight (Cliente)](https://wiki.mymp.gg/es/processLineOfSight.md): Lanza un rayo entre dos puntos y devuelve lo primero que toca.
- [isLineOfSightClear (Cliente)](https://wiki.mymp.gg/es/isLineOfSightClear.md): Indica si nada bloquea el segmento entre dos puntos. Solo bloquean edificios y objetos, no vehículos ni peds.
