Skip to content
lsl.devlsl.devLSL Dev

LlSetHoverHeight

Looking for the current API? Open the llSetHoverHeight reference →

Wiki description

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

Function notes

Do not use with vehicles.
Use llStopHover to stop hovering.

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
  • 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

Examples

// 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: functions

Shared wiki helpers

The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.

Template:LSL Function/physical

Original shared helper source (conditional wiki logic is not evaluated)
{{LSL Injection Test}}{{#if:

{{#vardefine:caveats|{{#var:caveats}}
*Only works in {{#if:{{{avatar|}}}|attachments and}} [[STATUS_PHYSICS|physics-enabled]] objects.}}

}}<noinclude>
{| {{Prettytable}}
|- {{Hl2}}
! #var
! value
|-
{{VarPair|caveats}}
|}
</noinclude>

Template:LSL Function/damping

Original shared helper source (conditional wiki logic is not evaluated)
{{LSL Injection Test}}{{#if:

{{#vardefine:header_footnote|{{#var:header_footnote}}}}

{{#vardefine:p_{{{1|}}}_desc|seconds to critically damp in}}

{{#if:{{{1|}}}|{{#vardefine:hidden-text|{{#var:hidden-text}}{{LSLC|Damping}}}}}}

}}<includeonly>{{#if:{{{1|}}}|{{LSLC|Damping}}}}</includeonly><noinclude>
{| {{Prettytable}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_{{{1|}}}_desc}}
|-
{{VarPair|p_{{{1|}}}_hover}}
|-
{{VarPair|header_footnote}}
|}
</noinclude>

Template:LSLP

Original shared helper source (conditional wiki logic is not evaluated)
{{LSLPT|{{{1|}}}|{{{2|}}}|{{{3|}}}}}<noinclude>

Same exact syntax as [[Template:LSL Param]].
</noinclude>

Template:LSL Function/boolean

Original shared helper source (conditional wiki logic is not evaluated)
{{LSL Injection Test}}{{#if:

{{#vardefine:nbdv|{{#switch:{{uc:{{{default|}}}}}|T|TRUE=true|F|FALSE=false}}}}

{{#vardefine:p_{{{1|}}}_desc|{{#if:{{{bool|}}}|{{HoverLink|boolean{{#var:lang}}|A type that can only be true or false|boolean}},}} {{{pd|}}} {{#if:{{{bool|}}}{{{pd|}}}|{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}|{{ucfirst:{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}}}}} {{#vardefineecho:TRUE|{{LSL Const{{#var:lang}}|TRUE|integer|1}}}}{{#vardefine:FALSE|{{LSL Const{{#var:lang}}|FALSE|integer|0}}}}{{#if:{{{non-zero|}}}|{{Footnote|handle=non-zero|Any value that is not zero/{{#var:FALSE}} is treated the same as {{#var:TRUE}}. This behavior should not be depended upon.|Any value that is not zero/FALSE is treated the same as TRUE. This behavior should not be depended upon.}}}}{{#ifeq:{{#var:nbdv}}|true|&#32;({{HoverText|default|default for new objects etc}})}} {{#if:{{{td|}}}|{{{td|}}}|enables}}, {{#ifeq:{{{if|}}}|*|if|{{{if|}}}}} {{#var:FALSE}}{{#ifeq:{{#var:nbdv}}|false|&#32;({{HoverText|default|default for new objects etc}})}} {{#if:{{{fd|}}}|{{{fd|}}}|disables}}}}

{{#vardefine:p_{{{1|}}}_hover|{{#if:{{{bool|}}}|boolean,}} {{#if:{{{ph|}}}|{{{ph|}}}|{{{pd|}}}}} {{#if:{{{bool|}}}{{{pd|}}}{{{ph|}}}|{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}|{{ucfirst:{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}}}}} TRUE{{#ifeq:{{#var:nbdv}}|true|&#32;(default)}} {{#if:{{{th|}}}|{{{th|}}}|{{#if:{{{td|}}}|{{{td|}}}|enables}}}}, {{#ifeq:{{{if|}}}|*|if|{{{if|}}}}} FALSE{{#ifeq:{{#var:nbdv}}|false|&#32;(default)}} {{#if:{{{fh|}}}|{{{fh|}}}|{{#if:{{{fd|}}}|{{{fd|}}}|disables}}}}}}

}}<noinclude>
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|default=false}}</nowiki></code>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|default=false}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}</nowiki></code>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|bool=*|if=*|non-zero=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}</nowiki></code>{{{{FULLPAGENAME}}|bool|bool=*|if=*|non-zero=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|if=when|non-zero=*|td=3|th=4|fd=5|fh=6}}</nowiki></code>{{{{FULLPAGENAME}}|bool|if=when|non-zero=*|td=3|th=4|fd=5|fh=6}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
</noinclude>
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.