Why is my animation not working?
Error: LoadAnimation requires an Animation object
Script:
tool:WaitForChild("ShotAnimation").OnServerEvent:Connect(function(player)
local animation = script.Parent:FindFirstChild("ShotAnimation")
local character = player.Character or player.Character:Wait()
local humanoid = character:FindFirstChild("Humanoid")
animation.Parent = humanoid
local animationTrack = humanoid:WaitForChild("Animator"):LoadAnimation(animation)
if animationTrack then
animationTrack:Play()
end
end)