Difference between revisions of "LlStopMoveToTarget"

From Second Life Wiki
Jump to navigation Jump to search
 
(One intermediate revision by one other user not shown)
Line 16: Line 16:
|also_articles
|also_articles
|notes
|notes
|examples=<source lang="lsl2">integer gLockPrimInPlace;
default
{
    on_rez(integer sp)
    {
        llResetScript();
    }
    state_entry()
    {
        llStopMoveToTarget();
        llSetStatus(STATUS_PHYSICS, TRUE);
    }
    touch_start(integer total_number)
    {
        if (llDetectedKey(0) != llGetOwner())
        {
            return;
        }
        if (!llGetStatus(STATUS_PHYSICS))
        {
            llOwnerSay("Locking or unlocking position works only for physical objects.");
            return;
        }
        gLockPrimInPlace = !gLockPrimInPlace;
        if (gLockPrimInPlace)
        {
            llMoveToTarget(llGetPos(), 0.05);
            llOwnerSay("Locked in place.");
        }
        else
        {
            llStopMoveToTarget();
            llOwnerSay("Unlocked.");
        }
    }
}</source>
|cat1=Movement
|cat1=Movement
|cat2=Physics
|cat2=Physics

Latest revision as of 06:54, 11 April 2021

Summary

Function: llStopMoveToTarget( );
0.0 Forced Delay
10.0 Energy

Stops critically damped motion

Use in conjunction with llMoveToTarget
To stop rotation movement use llStopLookAt

Examples

integer gLockPrimInPlace;

default
{

    on_rez(integer sp)
    {
        llResetScript();
    }

    state_entry()
    {
        llStopMoveToTarget();
        llSetStatus(STATUS_PHYSICS, TRUE);
    }

    touch_start(integer total_number)
    {

        if (llDetectedKey(0) != llGetOwner())
        {
            return;
        }

        if (!llGetStatus(STATUS_PHYSICS))
        {
            llOwnerSay("Locking or unlocking position works only for physical objects.");
            return;
        }

        gLockPrimInPlace = !gLockPrimInPlace;
        if (gLockPrimInPlace)
        {
            llMoveToTarget(llGetPos(), 0.05);
            llOwnerSay("Locked in place.");
        }
        else
        {
            llStopMoveToTarget();
            llOwnerSay("Unlocked.");
        }

    }

}

Deep Notes

Signature

function void llStopMoveToTarget();