LlGetVel
From Second Life Wiki
| LSL Portal | | | Functions | | | Events | | | Types | | | Operators | | | Constants | | | Flow Control | | | Script Library | | | Tutorials |
Function: vector llGetVel( );
| 77 | Function ID |
| 0.0 | Delay |
| 10.0 | Energy |
Returns a vector that is the velocity of the object.
Velocity reported is relative to the global coordinate frame (the object rotation has no affect on this functions output).
Examples
//A very simple (and not very effective) way of keeping a physical object in place. //If you ever want to actually stop an object, use llMoveToTarget(llGetPos(), .1) default { state_entry() { vector spd; { @loop; if (llVecMag(spd = llGetVel()) > .001) { //We're accelerating... llApplyImpulse(-spd, 0) //Slow us down. } jump loop; } } }//Written by Xaviar Czervik

