Don't click here unless you want to be banned.

LSL Wiki : llGetAnimation

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
string llGetAnimation(key id)

Returns the current basic animation state for avatar id.

The basic animation states are the simplest description of the avatar's posture.

Here's a list of basic animations states returned by this function:

Hovering Down
Hovering Up
This is returned even when the avatar is sitting on something that stopped the generic sit animation and plays its own instead.
Sitting on Ground
Falling Down
Standing Up After falling a long distance, the Landing animation state is skipped and the Standing Up state is used. -EyanaYohkoh
Soft Landing
Turning Left
Turning Right

Note: This function does not return the specific animations currently played with llStartAnimation. See llGetAnimationList.

// make a list of all animations states
list l;

default {
    state_entry() {
        llSetTimerEvent(0.25); // poll current state (there is no event for these)

    timer() {
        string s;
        s = llGetAnimation(llGetOwner()); // get the current animation state
        llSetText(s, <1, 1, 1>, 1.0); // display it as floating text
        if (llListFindList(l, [s]) == -1) l += [s]; // if it's not already in the list, add it
    touch_start(integer num) {
        if (llDetectedKey(0) != llGetOwner()) return; // ignore everyone but the owner
        llInstantMessage(llGetOwner(), llList2CSV(l)); // IM the list to the owner

This function may seem slow in updating animation states. For example, in things like animation overrides, waiting until llGetAnimation returns "Standing" can cause the walk animation to continue for a moment after the avatar has stopped. If this affects you, try checking llGetVel instead, to see if you have stopped moving. --DirtyMcLean

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Agent/Avatar | Animation
There is no comment on this page. [Display comments/form]