llWater
function
Function syntax
float llWater(vector offset// Offset relative to the prim's position, expressed in local coordinates.
);- Returns
float- Energy
- 10
Water height is constant across each entire sim and is typically 20 meters but not always.
Returns a float that is the water height below the prim’s position + offset
float result = llWater(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 ) vTarget.z = fWaterLevel;10 collapsed lines
llSetRegionPos(vTarget);}
default{ touch_start(integer total_number) { FindGroundOrWater(); }}See also
Section titled “See also”Functions
Section titled “Functions”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.