# llSetHoverHeight

*LSL function*

```lsl
void llSetHoverHeight(float height, integer water, float tau);
```

- `float height`: Distance to hover above the ground or water.
- `integer water`: Boolean. If TRUE, hovers above water too; if FALSE, water is ignored.
- `float tau`: Timescale in seconds to critically damp the movement.

- Energy: 10

Critically damps the physical object's vertical movement to hover at height (above ground, or above water if water is TRUE) in tau seconds. Do not use with vehicles; call llStopHover to cancel.

Critically damps to a **height** above the ground (or water) in **tau** seconds.

Do not use with vehicles.

Use [llStopHover](/functions/llStopHover/) to stop hovering.

```lsl title="How to use" frame="terminal"
llSetHoverHeight(0.0, 0, 0.0);
```

## Caveats

- Do not rely on built-in limits. In the past, the difference between the object's initial position and the hover height was limited to 64 meters. Under SL Server 1.26.2 the limit is 4096 meters above the ground level.
- This is not a prim property; stopping or resetting the script stops `llSetHoverHeight`; same with the similar [llGroundRepel](/functions/llGroundRepel/)
- If the object tries to go above the height (like, walking up a prim ramp), `llSetHoverHeight` will pull it back down, unlike the similar [llGroundRepel](/functions/llGroundRepel/)

## Examples

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

```lsl collapse={1-19}
// Put in an attached prim and touch to start floating in air without flying.
// Touch again to drop to the ground.

integer gHovering = FALSE; // are we supposd to be hovering now?

default {
    touch_start(integer total_number) {
        if (!llGetAttached()) {
            llWhisper(0, "Wear me to play.");
            return;
        }

        if (gHovering) {
            llOwnerSay("Releasing you.");
            llStopHover();
        }
        else {
            llOwnerSay("Making you float...");

            // Start hovering 5 meters over our current location.
            vector myPosition = llGetPos();
            llSetHoverHeight(myPosition.z - llGround(ZERO_VECTOR) + 5.0, FALSE, 1.0);
        }

        gHovering = !gHovering; // flip the switch
    }
}
```

</details>

## See also

### Functions

- [llGroundRepel](/functions/llGroundRepel/) — Same as `llSetHoverHeight` but does not hover all the time
- [llStopHover](/functions/llStopHover/) — To stop hovering

---

*Source: [LlSetHoverHeight](https://wiki.secondlife.com/wiki/LlSetHoverHeight) on the Second Life Wiki. Content from the Second Life Wiki articles LlSetHoverHeight (revision 1216222, 2024-02-18), Template:LSL Function/physical (revision 1168828, 2012-06-11), Template:LSL Function/damping (revision 1168795, 2012-06-11), Template:LSLP (revision 1169053, 2012-06-13) and Template:LSL Function/boolean (revision 1185613, 2013-12-24), CC BY-SA 3.0.*

---

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