function
Function syntax
float llGround(vector offset// Offset relative to the prim's position, expressed in local coordinates.
);- Returns
float- Energy
- 10
Returns a float representing the ground height directly below the prim's position offset by the vector offset.
Returns a float that is the ground height directly below the prim position + offset
float result = llGround(ZERO_VECTOR);Examples
Section titled “Examples”Example 1
// Makes the object land on ground or on water
FindGroundOrWater(){ vector vTarget = llGetPos(); vTarget.z = llGround( ZERO_VECTOR ); float fWaterLevel = llWater( ZERO_VECTOR ); if( vTarget.z < fWaterLevel )11 collapsed lines
vTarget.z = fWaterLevel; llSetRegionPos(vTarget);}
default{ touch_start(integer total_number) { FindGroundOrWater(); }}See also
Section titled “See also”Functions
Section titled “Functions”llGroundContour— Gets the ground contourllGroundNormal— Gets the ground normalllGroundSlope— Gets the ground slopellEdgeOfWorld— Returns existence of neighboring sims
Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.