Can't stop an animation when using :GetPlayingAnimationTracks()

  1. What do you want to achieve?
    Stop the animation

  2. What is the issue?
    :Stop() doesnt give an error or anything but still fails to stop the animation

Here is my code:

for i, v in ipairs(Humanoid.Animator:GetPlayingAnimationTracks()) do
	if string.find(v.Name, "Hit") then
		v:Stop()
	end
end
print(Humanoid.Animator:GetPlayingAnimationTracks())

For some reason the animation doesnt stop. Here is what is printed out:

{
                    [1] = IdleFightingStyle,
                    [2] = HitTop,
                    [3] = Animation
                 }
1 Like

Check if it gets detected like, put a print() inside the if statement.

1 Like

It does and it prints HitTop when I do print(v.Name)

1 Like

Solved. Playing all the animations client side fixed it for some reason.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.