Skip to content

llGround

float llGround(vector Offset)

Returns the ground height at the object position + offset.

Returns the ground height at the object's position + Offset.

Parameters
Offset (vector)

This example lands an object on the ground or water surface, whichever is higher:

FindGroundOrWater()
{
vector vTarget = llGetPos();
vTarget.z = llGround(ZERO_VECTOR);
float fWaterLevel = llWater(ZERO_VECTOR);
if (vTarget.z < fWaterLevel)
vTarget.z = fWaterLevel;
llSetRegionPos(vTarget);
}
default
{
touch_start(integer total_number)
{
FindGroundOrWater();
}
}
  • [llGroundContour] - Gets the ground contour
  • [llGroundNormal] - Gets the ground normal
  • [llGroundSlope] - Gets the ground slope
  • [llEdgeOfWorld] - Returns existence of neighboring sims
  • [llWater] - Gets the water height at a location