Skip to content
lsl.devlsl.devLSL Dev

llGetAccel

function
Function syntax
vector llGetAccel();
Returns
vector
Energy
10

Returns a vector representing the acceleration of the object in the region's frame of reference.

Returns a vector that is the acceleration of the object in the region frame of reference.

How to use
vector result = llGetAccel();
  • Returns ZERO_VECTOR in attachments regardless of the avatar’s acceleration.
  • Returns ZERO_VECTOR in child prims regardless of the linkset’s acceleration.
Example 1
//A very simple (and not very effective) way of keeping a physical object in place.
//If the object is moving when the script is put in the object, then the object will continue to move, so long as it doesn't accelerate.
//If you ever want to actually stop an object, use llMoveToTarget(llGetPos(), .1)
default {
moving_start(){
vector ac;
// Go forever
while(llVecMag(ac = llGetAccel()) > .001) { //We're accelerating...
llApplyImpulse(-ac, 0); //Slow us down.
}
}
}
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from LlGetAccel, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.