Basically my animation doesn’t work and I tried to make it work but still the animation never plays
this is the script
local player = game.Players.LocalPlayer
local tool = script.Parent.Parent
local handle = script.Parent
local punchbool = script.Parent:WaitForChild("IsPunching")
local cooldown = script.Parent.PunchCooldown
local event = script.Parent.Event
local swing = script.Parent.SwingSound
local animator = player.Character:FindFirstChild("Humanoid"):WaitForChild("Animator")
local animationtrack = animator:LoadAnimation(script.Parent.Punch)
tool.Activated:Connect(function()
print("coolio")
animationtrack:Play()
end)
You’re using :FindFirstChild when searching for the humanoid. If this script runs when the player joins, it won’t be able to find the player’s humanoid, therefore not finding the animator.
Alright, so first make sure that you’ve actually assigned the animationId to the Punch animation instance, sometimes we can get a little gullible and forget about that