(Solved) How to stop a specific animation track without stopping other tracks

I am making a custom tool holding animation system and the custom animation will be stopped when the tool is unequipped

I do not know how to though stop a specific animation when the tool is unequipped

I did tried the following code but the issue is that all animation playing will be stopped when the code runs (including walking/idle animations)

script.Parent.Unequipped:Connect(function()	
	local Player = game.Players.LocalPlayer
	local AnimationTracks = Player.Character.Humanoid:GetPlayingAnimationTracks()
	for i, v in pairs(AnimationTracks) do
		v:Stop()
	end
end)
2 Likes

Maybe you can save the animations that were run by the script, then you loop through that table instead.

:GetPlayingAnimationTracks() returns an array of animation track instances, you could have indexed their name properties and determined if one matched a particular name.

3 Likes