Skip to content
lsl.devlsl.devLSL Dev

LlTargetRemove

Looking for the current API? Open the llTargetRemove reference →

Wiki description

Removes positional target handle registered with llTarget

Examples

integer target_id;
vector target_pos;

default
{
    state_entry()
    {
        target_pos = llGetPos() + <1.0, 0.0, 0.0>;
        target_id = llTarget(target_pos, 0.5);
    }
    at_target(integer tnum, vector targetpos, vector ourpos)
    {
        if (tnum == target_id)
        {
            llOwnerSay("object is within range of target");
            llOwnerSay("target position: " + (string)targetpos + ", object is now at: " + (string)ourpos);
            llOwnerSay("this is " + (string)llVecDist(targetpos, ourpos) + " meters from the target");
            llTargetRemove(target_id);
        }
    }
    not_at_target()
    {
        llOwnerSay(
            "not there yet - object is at " + (string)llGetPos() + 
            ", which is " + (string)llVecDist(target_pos, llGetPos()) + 
            " meters from the target (" + (string)target_pos + ")"
        );
    }
}

See also: functions

See also: events

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/handle

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

{{#vardefine:p_{{{1|}}}_desc|handle to control [[{{{2|}}}{{#var:lang}}|{{{2|}}}]] {{#if:{{{3|}}}|and [[{{{3|}}}{{#var:lang}}|{{{3|}}}]] events|event}}}}

{{#vardefine:p_{{{1|}}}_hover|handle to control {{{2|}}} {{#if:{{{3|}}}|and {{{3|}}} events|event}}}}

}}<noinclude>
{| {{Prettytable}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p__desc}}
|-
{{VarPair|p__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.