Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is there an easy way to stop the humanoid from playing animations?

Asked by 4 years ago

I'm trying to get an animation to play. The issue is that if you play the animation and then start another one (e.g. walk or jump,) the original animation is cancelled. Currently, I use this code to stop any existing animations:

local a = chr:GetPlayingAnimationTracks()
        for _,v in pairs(a) do
            v:Stop()
        end

After this, the animation gets played. The problem is that this only accounts for animations that begin before my animation begins, not afterwards. Is there a way to prevent any new animations from playing?

0
i think the chr:GetChildren() would work. DEVLogos 8 — 4y
0
@DEVLogos I'm not sure what you mean. iiMurpyh 7 — 4y
0
This question is more along the lines of 'how to animate properly'. I believe Mirzadaswag's answer is sufficient. alphawolvess 1784 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Sometimes custom animations get overridden by other animations. This all depends on the priority of the animation. If you want the animation to play on top of everything without getting overridden, you'll have to change your animation's priority. This is how prioritizing animations works:

If an animation with a higher priority is played after an animation with lower priority, the lower priority animation ends and the higher priority animation plays on top of it.

What if two or more animations on the same priority are played after each other? Any current animation[1] can be overridden by the same priority animation[2], if Animation [2] plays after Animation [1]. Whatever order it is, it still does that.

Core is the lowest priority ever.

Idle is for idle animations, and should be used for just that purpose.

Movement is for movement animations, and again for that purpose.

Action is the highest priority of animations, and should be used for, any specific action, like reloading a gun, picking up an item, punching, etc.

So hopefully you can apply your knowledge with a solution to this problem now.

EDIT: please forgive me if i have disobeyed the mods

0
My animations are all set to the Action priority, but still get overridden by walking and jumping (which I beleive are either Core or Movement priority.) I'll double check right now. iiMurpyh 7 — 4y
0
Appears that I was wrong! Thanks for the help in finding the issue. iiMurpyh 7 — 4y
Ad

Answer this question