Difference between revisions of "LlStopMoveToTarget"

From Second Life Wiki
Jump to navigation Jump to search
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{LSLFunctionAll|func_id=71|func_sleep=0.0|func_energy=10.0|func=llStopMoveToTarget|func_footnote=Stops critically damped motion|return_text|spec|caveats|examples|helpers|related|also|notes}}[[Category:LSL_Functions]][[Category:LSL_Stub]]
{{LSL_Function
|func_id=71|func_sleep=0.0|func_energy=10.0
|func=llStopMoveToTarget
|func_footnote=Use in conjunction with {{LSLG|llMoveToTarget}}<br/>
To stop rotation movement use {{LSLG|llStopLookAt}}
|func_desc=Stops critically damped motion
|return_text
|spec
|caveats
|constants
|examples
|helpers
|also_functions
|also_tests
|also_events
|also_articles
|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
|cat2=Physics
|cat3=Target
|cat4
}}

Latest revision as of 07:54, 11 April 2021

Summary

Function: llStopMoveToTarget( );

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

Search JIRA for related Issues

Signature

function void llStopMoveToTarget();