# llDetectedVel

*LSL function*

```lsl
vector vector llDetectedVel(integer number);
```

- `integer number`: Index of the detection information.

- Returns: `vector`
- Energy: 10

Returns the vector velocity of the detected object or avatar specified by number, or <0.0, 0.0, 0.0> if number is not a valid offset index.

Returns [&lt;0.0, 0.0, 0.0>](/constants/ZERO_VECTOR/) if **number** is not valid sensed object or avatar.

```lsl title="How to use" frame="terminal"
vector result = llDetectedVel(0);
```

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-11}
//Tells the name and velocity of all near-by avatars.
default
{
    state_entry()
    {
        // Scan once for avatars within a 96 metre radius sphere
        llSensor("", "", AGENT, 96, PI);
    }
    sensor(integer num)
    {
        // num will initially be 1 or more. When num is 1, the index of the detected avatar will be zero
        while(num--)
        {
            llOwnerSay(llDetectedName(num) + " is moving at " + (string)llVecMag(llDetectedVel(num)) + " m/s.");
        }
    }
}
```

</details>

## Known issues

From the issue templates included by the wiki article:

- SVC-5821 (bug): Velocity is reduced to maximum of 200.0m/s on instant of collision and llDetectedVel reports this incorrect value.

---

*Source: [LlDetectedVel](https://wiki.secondlife.com/wiki/LlDetectedVel) on the Second Life Wiki. Content from the Second Life Wiki articles LlDetectedVel (revision 1198875, 2016-01-18), Template:Issues/SVC-5821 (revision 929862, 2010-05-27) and Template:LSL Function/detected (revision 1168823, 2012-06-11), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llDetectedVel/
