Why is my animation not working

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)

What is ShotAnimation? Judging by the error it doesn’t see it as an Animation Instance? Do you by any chacne have something else called ShotAnimation that the script could be getting instead?

Yes…I do…the remote event is called “ShotAnimation” as well as the actual animation. It must be mistaking the event for the animation. Thank you so much!

1 Like