Skip to content
lsl.devlsl.devLSL Dev

llWater

function
Function syntax
float llWater(
  1. 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

How to use
float result = llWater(ZERO_VECTOR);
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();
}
}
  • llGround — Gets the ground height
  • llWind — Gets the wind velocity
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.

From the Second Life Wiki

Community documentation adapted from LlWater, by Linden Research, Inc. and contributing residents.View contributors and history.

Built from these wiki pages, as imported:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.