Pausing and resuming playing animation track in npc?

Hello! So what I know is that you can stop all playing animations in a npc by

for i, v in pairs(NPC.Humanoid.Animator:GetPlayingAnimationTracks())
   v:Stop()
end

but what if I want to resume them later on again? Is this possible?

You can set the AnimationTrack’s Speed to 0 and then back to 1. (you can do this with AnimationTrack:AdjustSpeed())

2 Likes

I did that but I want it to be the default standing pose when the animation stops, when I do that it just stops middle of the animation.

Can you explain to me what exactly you want to do with this?

1 Like

I want it so that I can stop the npc’s animation from a script, and once animation A is stopped, I play animation B on the npc. Once animation B is finished playing, animation A resumes and animation B stops.

Well, if Animation B’s Priority is higher then you can pause A with the speed method I mentioned and then when B is finished, change the speed of A back to normal

1 Like

ah ok, so when I play animation B the animation A’s paused animation awkward pose won’t happen I guess? I will try this later thanks!

Maybe you can use TimePosition?

2 Likes

Yes, exactly. You can change the priority of B in the anim editor

1 Like

Oh wow I didn’t know a thing like this exists, I will try both of your ideas later. Thanks!

Yes, you can save the TimePosition and then :Stop() A and then :Play() and set back the TimePosition.

1 Like