Difference between revisions of "LlDetectedVel"

From Second Life Wiki
Jump to navigation Jump to search
(Added Example)
Line 9: Line 9:
|caveats
|caveats
|constants
|constants
|examples
|examples=
<pre>
//Tells the name and velocity of all near-by avatars.
default {
    state_entry() {
          llSensor("", "", AGENT, 10000, 10000);
    }
    sensor(integer num) {
          integer i = 0;
          while (i < num) {
              llOwnerSay(llDetectedName(i) + " is moving at " + (string)llVecMag(llDetectedVel(i)) + " m/s.");
              i++;
          }
    }
}
</pre>
|helpers
|helpers
|also_functions
|also_functions

Revision as of 15:50, 13 October 2007

Summary

Function: vector llDetectedVel( integer number );
0.0 Forced Delay
10.0 Energy

Returns a vector that is the velocity of detected object number.

• integer number

number does not support negative indexes. Returns <0.0, 0.0, 0.0> if number is not valid sensed object.

Caveats

  • If number is out of bounds the script continues to execute without an error message.

Examples

//Tells the name and velocity of all near-by avatars.
default {
     state_entry() {
          llSensor("", "", AGENT, 10000, 10000);
     }
     sensor(integer num) {
          integer i = 0;
          while (i < num) {
               llOwnerSay(llDetectedName(i) + " is moving at " + (string)llVecMag(llDetectedVel(i)) + " m/s.");
               i++;
          }
     }
}

See Also

Articles

•  Detected

Deep Notes

Signature

function vector llDetectedVel( integer number );