Difference between revisions of "LlStopHover"

From Second Life Wiki
Jump to navigation Jump to search
 
m (Replaced old <LSL> block with <source lang="lsl2">)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{LSLFunctionAll|func_id=124|func_sleep=0.0|func_energy=10.0|func=llStopHover|func_footnote=Stop hovering to a height|return_text|spec|caveats|examples|helpers|related|also|notes}}[[Category:LSL_Functions]][[Category:LSL_Stub]]
{{LSL_Function
|func_id=124|func_sleep=0.0|func_energy=10.0
|func=llStopHover
|func_footnote
|func_desc=Stop hovering to a height
|return_text
|spec
|caveats
|constants
|examples=<source lang="lsl2">
// 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
    }
}
</source>
|helpers
|also_functions=
{{LSL DefineRow||[[llGroundRepel]]|}}
{{LSL DefineRow||[[llSetHoverHeight]]|}}
|also_tests
|also_events
|also_articles
|notes
|cat1=Physics
|cat2=Hover
|cat3=Stop
|cat4
}}

Latest revision as of 12:42, 22 January 2015

Summary

Function: llStopHover( );

Stop hovering to a height

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

•  llGroundRepel
•  llSetHoverHeight

Deep Notes

Search JIRA for related Issues

Signature

function void llStopHover();