# llSetAnimationOverride

*LSL function*

```lsl
void llSetAnimationOverride(string anim_state, string anim);
```

- `string anim_state`: Animation state to override.
- `string anim`: Name of an animation in the prim's inventory, or a built-in animation name.

- Energy: 10
- Permission: `PERMISSION_OVERRIDE_ANIMATIONS`

Overrides the default animation for anim_state with anim (which must be in the object's inventory or a built-in animation). Requires the PERMISSION_OVERRIDE_ANIMATIONS permission.

Set the animation (**anim**) that will play for the given animation state (**anim_state**).

Note: Animation overrides survive everything, except relog.

```lsl title="How to use" frame="terminal"
llSetAnimationOverride("", "");
```

## Specification

****

| Value | Type | Description | Default |
| --- | --- | --- | --- |
| "Crouching" | State |  | crouch |
| "CrouchWalking" | State |  | crouchwalk |
| "Falling Down" | State |  | falldown |
| "Flying" | State |  | fly |
| "FlyingSlow" | State | Transition between hovering and forward flight. | flyslow |
| "Hovering" | State |  | hover |
| "Hovering Down" | State |  | hover_down |
| "Hovering Up" | State |  | hover_up |
| "Jumping" | State | While still in the air during a jump. | jump |
| "Landing" | Transition | When landing from a jump. | land |
| "PreJumping" | Transition | At the beginning of a jump. | prejump |
| "Running" | State |  | run |
| "Sitting" | State | Sitting on an object (and linked to it). | sit |
| "Sitting on Ground" | State | Sitting, but not linked to an object.[^wiki-fe736d] | sit_ground_constrained |
| "Standing" | State |  | stand |
| "Standing Up" | Transition | After falling a great distance. Sometimes referred to as Hard Landing. | standup |
| "Striding" | State | When the avatar is stuck on the edge of an object or on top of another avatar. | stride |
| "Soft Landing" | Transition | After falling a small distance. | soft_land |
| "Taking Off" | State |  | hover_up |
| "Turning Left" | State |  | turnleft |
| "Turning Right" | State |  | turnright |
| "Walking" | State |  | walk |

[^wiki-fe736d]: "Sit down" on the avatar context menu allows ground sits anywhere: atop the terrain, objects or even in the air.

## Caveats

- Animation overrides survive script reset, script removal, attachment removal, crossing into another region and teleporting, but not relog.
- State "Sit on Ground" will play the default animation in addition to any override set. This is required for correct viewer behavior.
- Some states are transitional and have undefined behavior if set to continuously looping animations. These states are "PreJumping", "Landing", "Soft Landing" and "Standing Up".
- Usually this means your avatar will become frozen in place unless you run "Stop Animating My Avatar" from the viewer, so avoid using looping animations for these states.
- Permissions aren't auto granted if you sit on an object asking for [PERMISSION_OVERRIDE_ANIMATIONS](/constants/PERMISSION_OVERRIDE_ANIMATIONS/).
- Starting a default animation ("sit" "walk" "fly") with [llStartAnimation](/functions/llStartAnimation/) will not start the Override Animation.
- When this function is used to override the Walking animation, the avatar can no longer walk backward - attempting to do so causes the avatar to turn around. Presumably this is because there's no way to specify a "walking backwards" animation, so actually moving backwards while your legs are moving forward would look wrong.

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-18}
// Override the Sit, Stand and Walk animations
// 1. place this script and your animations in a prim
// 2. edit the animation names in the script to your animation's names
// 3. attach the prim to your avatar

string gMySit = "chop_sit";
string gMyStand = "FStand _02";
string gMyWalk = "Kort gang F v4.1";

default
{
    attach(key id)
    {
        if ( id ) llRequestPermissions(id , PERMISSION_OVERRIDE_ANIMATIONS);
        else if ( llGetPermissions() & PERMISSION_OVERRIDE_ANIMATIONS ) llResetAnimationOverride("ALL");
    }
    run_time_permissions(integer perms)
    {
        if ( perms & PERMISSION_OVERRIDE_ANIMATIONS )
        {
            llSetAnimationOverride( "Sitting", gMySit);
            llSetAnimationOverride( "Standing", gMyStand);
            llSetAnimationOverride( "Walking", gMyWalk);
        }
    }
}
```

</details>

## History

Date of Release [12/04/2013](https://wiki.secondlife.com/wiki/Release_Notes/Second_Life_Server/13#13-04-12-273874)

## See also

### Functions

- [llGetAnimationOverride](/functions/llGetAnimationOverride/)
- [llResetAnimationOverride](/functions/llResetAnimationOverride/)

### Articles

- [Internal_Animations](https://wiki.secondlife.com/wiki/Internal_Animations) — lists internal Animations always available

---

*Source: [LlSetAnimationOverride](https://wiki.secondlife.com/wiki/LlSetAnimationOverride) on the Second Life Wiki. Content from the Second Life Wiki articles LlSetAnimationOverride (revision 1194513, 2015-01-22), Template:LSL Function/permission (revision 1200093, 2016-05-12) and Template:LSL Function/inventory (revision 1191151, 2014-06-07), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llSetAnimationOverride/
