Tool animation broken?

local humanoid = game.Players.LocalPlayer.Character.Humanoid
local plr = game.Players.LocalPlayer
local tool = plr.Character:FindFirstChild("Axe")
local swing = tool:WaitForChild("SwingAnimation")

	local mouse = plr:GetMouse()
		local animplay = humanoid:LoadAnimation(swing)

Screen Shot 2020-10-15 at 19.37.05

19:34:42.242 - Stack Begin

[19:34:42.243 - Script 'Players.vf9r.Backpack.Axe.Swing', Line 4](rbxopenscript://

19:34:42.243 - Stack End

I am trying to make it so when I click with the axe equipped it plays an animation, ut it doesn’t play the animation, and says “WaitForChild” isn’t a thing when referenced with animation. If I don’t use WaitForChild or FindFirstChild when getting an instance, it says that it doesn’t exist.

I think what’s likely happening is that when your character first spawns, your tool is parented to LocalPlayer.Backpack, not Character. You should instead do tool = script.Parent.

As @AstroCode Said , it always precise to use script.Parent , since its getting the tool no matter where it is located.

Now it says " 17:09:27.082 - SwingAnimation is not a valid member of Tool “Players.vf9r.Backpack.Axe”"

Can you show me your Current Script ? I believe that you are missing Something somewhere and also be aware of your Capitalization.

is the animation set as a action?