# llStopAnimation

*LSL function*

```lsl
void llStopAnimation(string anim);
```

- `string anim`: Name of the animation in the prim's inventory, the UUID of the animation, or the built-in animation name.

- Energy: 10
- Permission: `PERMISSION_TRIGGER_ANIMATION`

Stops the specified animation anim (inventory, built-in, or UUID) on the avatar who granted the script the PERMISSION_TRIGGER_ANIMATION permission (automatically granted for attached or sat-on objects).

Stop animation **anim** for agent that granted [PERMISSION_TRIGGER_ANIMATION](/constants/PERMISSION_TRIGGER_ANIMATION/) if the permission has not been revoked.

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

## Caveats

- If the animation to be stopped is the only playing animation (as found via [llGetAnimationList](/functions/llGetAnimationList/)), it will continue to play to its end (if looped it will continue indefinitely)
- if you must stop a looped animation, playing a single frame non-looped one immediately after stopping it, at low priority, will clear the list.

## Examples

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

```lsl collapse={1-16}
default
{
    touch_start(integer detected)
    {
        llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION);
    }
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
        {
            llStartAnimation("sit");
            llOwnerSay("animation will end in 5 seconds");
            llSetTimerEvent(5.0);
        }
    }
    timer()
    {
        llSetTimerEvent(0.0);
        llStopAnimation("sit");
    }
}
```

</details>

## Notes

```lsl
llStopAnimation(llGetAnimationOverride("Sitting"))
```

## Known issues

From the issue templates included by the wiki article:

- SVC-3860: type=bug|llStopAnimation("prejump") freezes avatar

## See also

### Functions

- [llGetAnimationList](/functions/llGetAnimationList/) — Gets a list of playing animations
- [llStartAnimation](/functions/llStartAnimation/) — Starts playing an animation

---

*Source: [LlStopAnimation](https://wiki.secondlife.com/wiki/LlStopAnimation) on the Second Life Wiki. Content from the Second Life Wiki articles LlStopAnimation (revision 1194370, 2015-01-22), Template:Issues/SVC-3860 (revision 380892, 2009-06-03), 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/llStopAnimation/
