llGetVel

From Second Life Wiki
Revision as of 12:08, 8 February 2008 by Xaviar Czervik (talk | contribs) (Added example.)
Jump to navigation Jump to search

Summary

Function: vector llGetVel( );

Returns a vector that is the velocity.

Examples

<lsl> //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;
         while (1 == 1) // Go forever
              if (llVecMag(spd = llGetVel()) > .001) { //We're accelerating...
                   llApplyImpulse(-spd, 0) //Slow us down.
              }
         }     }

} Code by Xaviar Czervik

</lsl>

See Also

Functions

•  llGetAccel
•  llGetOmega

Deep Notes

Search JIRA for related Issues

Signature

function vector llGetVel();