Delete playing animation

Hi guys,

I have problem/question.
I found here on forum that I can read loaded animations in Humanoid:

local animTracks = plr.Character.Humanoid:GetPlayingAnimationTracks()
		print(animTracks)

so then I can easy stop animation which I want. But thing what I cant do is delete animation from humanoid ? or can I read if this animation is stopped ?

I want to stop/play animation.
I am reading this table if there is my animation I want to stop but then I want to play animation but problem is that stopped animation is still there.

GetPlayingAnimationTracks() returns an array of animation tracks which are currently playing on the character’s humanoid instance. You need to iterate over this array with a generic for loop.

for _, animationTrack in ipairs(humanoid:GetPlayingAnimationTracks()) do
	animationTrack:Stop()
end
1 Like

Hi, I can stop animation but when I want play same again its not possible

local animationTracks = humanoid:GetPlayingAnimationTracks()
for _, animationTrack in ipairs(animationTracks) do
	animationTrack:Stop()
end
animationTracks[math.random(#animationTracks)]:Play()
1 Like