Don't click here unless you want to be banned.

LSL Wiki : llDetectedLinkNumber

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
integer llDetectedLinkNumber(integer number)

Returns the link position (0 for a non-linked object, 1 for the root (parent) of a linked object, 2 for the first child, etc.) of the object the touch or collision event is triggered for.

See also llPassTouches and llPassCollisions.

This is most useful for finding out which prim was touched without having to put a script into each prim.

As of SL 1.6.7, llDetectedLinkNumber will only ever return 0 when used with llVolumeDetect, even when used in a multi-prim object. This may be caused by the fact that llVolumeDetect was added some time after the original detected functions. There is not yet any word on when this might be fixed.

Note to Note
Actually, I just tried it and when the llDetectedLinkNumber is in a touch_start event, and in an unlinked prim, it returns 0.

Note to Note to Note
I tried llDetectedLinkNumber in a touch_start event, and it worked perfectly well (As is is stated in the No need to use the touch event.

As stated in llPassTouches
When passing touches, to determine what prim in the linkset has been touched, use llDetectedLinkNumber in the parent prim.

Note about llDetectedTouchFace
llDetectedTouchFace will return the correct face of the child prim touched when used in conjunction with llDetectedLinkNumber.

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Detected Functions | Link
Comments [Hide comments/form]
a very simple example:

    touch_start(integer total_number)
        integer numberLinked = llDetectedLinkNumber(0);
        llSay(0, "Touched on prim: " + (string)numberLinked );
-- NonnuxWhite (2005-07-25 03:07:11)
What is the "number" parameter? It's not documented.
-- (2007-05-09 09:26:57)
The number parameter is the detection number... just like in llDetectedName(integer number) and all the other llDetected* functions.
-- (2007-05-11 09:44:46)
what is the "number" parameter? it is still not clear.

although it was explained once as: "The number parameter is the detection number... just like in llDetectedName(integer number) and all the other llDetected* functions".

what is the "detection number"?
-- (2007-06-13 06:24:23)
The integer value is explained in the generic "Detection" entry. Simple explanation of this can be made using llSensor. llSensor triggers the sensor event only once even though it may have "found" multiple agents/objects. The integer param in the llDetected* functions allow us to specify which agent/object we want data on. 0 returns data on the first agent/avatar, 1 returns data on the second.. etc....
-- EvoCommons (2007-07-06 02:04:40)
What if it's a land_collision_start?
-- (2007-11-26 12:38:18)
Attach a comment to this page: