Difference between revisions of "LlGetAnimation"

From Second Life Wiki
Jump to: navigation, search
(sit vs. ground sit)
Line 65: Line 65:
{{!}}Sitting on an object.
{{!}}Sitting on an object (and linked to it).
{{!}}"Sitting on Ground"
{{!}}"Sitting on Ground"
{{!}}Sitting on the terrain.
{{!}}Sitting, but not linked to an object.{{Footnote|1=[[Snowglobe]] and many [[alternate viewers]] allow ground sits anywhere, atop ground, objects or even in the air.}}

Revision as of 19:06, 26 June 2010


Function: string llGetAnimation( key id );

Returns a string that is the name of the currently playing locomotion animation for avatar id. See the table below.

• key id avatar UUID that is in the same region

llGetAgentInfo provides information on some animation states not covered by this function (typing, away, busy). llGetAnimationList provides more detailed information about the running animations, but may not reflect avatar state as accurately as llGetAnimation.

Value Description
"" During logout
"Falling Down"
"Hovering Down"
"Hovering Up"
"Jumping" While still in the air during a jump.
"Landing" When landing from a jump.
"PreJumping" At the beginning of a jump.
Value Description
"Init" At login and after teleports.
"Sitting" Sitting on an object (and linked to it).
"Sitting on Ground" Sitting, but not linked to an object.[1]
"Standing Up" After falling a great distance. Sometimes referred to as Hard Landing.
"Striding" When the avatar is stuck on the edge of an object or on top of another avatar.
"Soft Landing" After falling a small distance.
"Taking Off"
"Turning Left"
"Turning Right"


  • This function can return an empty string while the avatar is logging out.
  • New return values could conceivably be added at any time and this list may not in-fact be complete. Scripts should be written under the assumption that they may receive a value they won't recognize.
All Issues ~ Search JIRA for related Bugs


<lsl> // A simple animation override example. // Make the avatar run in mid-air when jumping.

key gOwner; // the wearer's key string gLastAnimation; // last llGetAnimation value seen

// User functions

Initialize(key id) {

   if (id == NULL_KEY) { // detaching
       llSetTimerEvent(0.0); // stop the timer
   else { // attached, or reset while worn
       llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);
       gOwner = id;


// Event handlers

default {

   state_entry() {
       // in case the script was reset while already attached
       if (llGetAttached() != 0) {
   attach(key id) {
   run_time_permissions(integer perm) {
           llSetTimerEvent(0.25); // start polling
   timer() {
       string newAnimation = llGetAnimation(gOwner);
       if (gLastAnimation != newAnimation) { // any change?
           if (newAnimation == "Jumping") {
               // You can stop the built-in animation if you like, if
               // it might interfere with your own. Be aware that an
               // avatar can become stuck, and some llGetAgentInfo results
               // can be inaccurate, if you stop built-ins indiscriminately.
               // Always test.
               // llStopAnimation("jump");
           else if (gLastAnimation == "Jumping")  { // just finished jumping
               // "run" is looped, so we have to stop it when we are done.
           gLastAnimation = newAnimation; // store away for  next time



See Also


•  llGetAgentInfo
•  llGetAnimationList

Deep Notes

Search JIRA for related Issues


  1. ^ Snowglobe and many alternate viewers allow ground sits anywhere, atop ground, objects or even in the air.


function string llGetAnimation( key id );