Difference between revisions of "LlStopHover"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 8: Line 8:
|caveats
|caveats
|constants
|constants
|examples
|examples=<lsl>
// 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
    }
}
</lsl>
|helpers
|helpers
|also_functions=
|also_functions=

Revision as of 12:58, 14 June 2011

Summary

Function: llStopHover( );
0.0 Forced Delay
10.0 Energy

Stop hovering to a height

Examples

<lsl> // 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
   }

}

</lsl>

See Also

Functions

•  llGroundRepel
•  llSetHoverHeight

Deep Notes

Signature

function void llStopHover();