Error on loading animations?

Im getting this error when loading an animation, what does it mean and how do I fix it?

local Player = game:GetService("Players").LocalPlayer

local Tool = script.Parent

local Anim1 = Tool:WaitForChild("Idle")

local Humanoid = Player.Character:WaitForChild("Humanoid")

local Idle = Humanoid:LoadAnimation(Anim1)

local UIS = game:GetService("UserInputService")

local Mouse = Player:GetMouse()

local Remote = Tool:WaitForChild("Remote")

local Remote2 = Tool:WaitForChild("Remote2")

local Tracks = {}

local InputType = Enum.UserInputType

image

By the way the end says “game object”

Well im not going to lie. But this has been going on for a week or 2, but I just posted about it as of now.

Maybe an update just ruined something.

1 Like

Possibly, I will look into different solutions into fixing this.

1 Like

Try loading & playing the animation via the Animator. It should be a child of Humanoid iirc.

Where is the Player’s character located, based on the error in the script I get the presumption that you set the parent to nil.

1 Like

I never had a problem with this besides a possible infinite yield:

test%20-%20Roblox%20Studio%2010_7_2019%204_13_04%20PM

also I had this script in ServerScriptService and instead of “WaitForChild:(“Humanoid”)”
do FindFirstChild so it can find the humanoid instead of waiting for it to appear in your character.

Another note too, make sure to play your animation so at the end you would have:

Idle:Play()