key llDetectedKey(integer number)
Returns the
key of
detected object number (returns
NULL_KEY if number is not valid
sensed object).
Note: The
llDetected* functions will only return a meaningful
value in the
collision(),
collision_start(),
collision_end(),
sensor(),
touch(),
touch_start(), or
touch_end() events.
Q:
Is this a 0-based or 1-based index?
A:
0-based; This function starts counting at 0. -
Chris
Example:
// Alternate example by Wouter Hobble
// llDetectedKey if there might be multiple keys detected.
default
{
collision(integer num_detected)
{
integer i = 0;
while ( i < num_detected) // Shout something for every key detected.
{
llShout(0, "Colliding Key: " + llDetectedKey(i));
++i;
}
}
}
This article wasn't helpful for you? Maybe the
related article at the LSL Portal is able to bring enlightenment.
Functions |
Detection |
Sensors