Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does the animation end when the npc is moved?

So I created an animation so that it plays on an npc, however everytime that it is pushed or moved, the animation stops. I need that animation to play for the full 5 seconds that I made it last, but it doesn't do it because it could get interrupted easily. I've seen animations of players dancing and when they walk their animation doesn't stop. They keep dancing. How do I create animations like that?

Here's what I have:

local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=856992503"

local animTrack = npc.Humanoid:LoadAnimation(animation)
animTrack:Play()

wait(5)

Before you evaluate, take note that yes the animation plays for 5 seconds (I placed the last keyframe of the animation at the 5 second mark). And also, the npc has a humanoid in it. It can also walk just like a regular player when I script it to do so. It's just when it's being pushed or something is in its way that it stops during the animation. I want it to play out the animation throughout even if it gets pushed or whatever.

Thanks for the help!

1 answer

Nevermind! I found a solution! So all I had to do was change the priority of the animation in the animation editor to "Action", since action animation have the highest priority thus won't be overwritten by any "Core"-priority animations such as the walking animation.

Thanks anyway!

This discussion is preserved as it was. New answers, comments, and votes are closed.