M MY Multiplayer: Wiki
Lado
Tipo

getGroundPosition

Cliente

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

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

Parámetros

NombreTipoDescripción
x, y, zfloatEl 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

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