llSetHoverHeight
function
Function syntax
llSetHoverHeight(float height,// Distance to hover above the ground or water.integer water,// Boolean. IfTRUE, hovers above water too; ifFALSE, 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 to stop hovering.
llSetHoverHeight(0.0, 0, 0.0);Caveats
Section titled “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 similarllGroundRepel - If the object tries to go above the height (like, walking up a prim ramp),
llSetHoverHeightwill pull it back down, unlike the similarllGroundRepel
Examples
Section titled “Examples”Example 1
19 collapsed lines
// 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 }}See also
Section titled “See also”Functions
Section titled “Functions”llGroundRepel— Same asllSetHoverHeightbut does not hover all the timellStopHover— To stop hovering
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.