# llWater

*LSL function*

```lsl
float float llWater(vector offset);
```

- `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](https://wiki.secondlife.com/wiki/float) that is the water height below the prim's [position](/functions/llGetPos/) + **offset**

```lsl title="How to use" frame="terminal"
float result = llWater(ZERO_VECTOR);
```

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={10-19}
// 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;
    llSetRegionPos(vTarget);
}

default
{
    touch_start(integer total_number)
    {
        FindGroundOrWater();
    }
}
```

</details>

## See also

### Functions

- [llGround](/functions/llGround/) — Gets the ground height
- [llWind](/functions/llWind/) — Gets the wind velocity

---

*Source: [LlWater](https://wiki.secondlife.com/wiki/LlWater) on the Second Life Wiki. Content from the Second Life Wiki articles LlWater (revision 1194322, 2015-01-22) and Template:LSL Function/offset (revision 1169422, 2012-06-18), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llWater/
