The problem with animation

Hello there ! First of all I want to say that I wanted to make animation in tool - when player click he play animation . And here you can see my explorer
image
and full my script in tool

 Debounce = false
local animations = script.Parent.Animation1

script.Parent.Equipped:Connect(function(Mouse)
	Mouse.Button1Down:Connect(function()
		if Debounce == false then
			Debounce = true
            animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animations)
		    animation:Play()
			wait(0.9)
			animation:Stop()
			wait(0.1)
			Debounce = false
		end
    end)
end)

script.Parent.Unequipped:Connect(function()
	animation:Stop()
end)

Do you know what’s wrong , Thank you :slight_smile: !

1 Like

You never said what is wrong with the animation that needs to be fixed…

Is it not playing at all, is it not stopping, etc. Just specify what is wrong here to help all of us understand the issue at hand.

2 Likes

oh yeh sorry , that isn’t playing when you click . But it is really weird because it looks like I made all correctly .

Try setting the animation priority to action if you havent already, also I’m pretty sure that last event could cause a error if the animation isint playing and you unequip it, I’d put a check if it’s playing to be sure.

1 Like

I’ve made before punching tool and it worked fine with the same script I just put other animaton so it can play like player hits with this tool . And yeh I’ll try to make it action , thank you !

1 Like

Yeah because when its set to action the priority is the highest so it would overwrite other animations that aren’t set to action