Animator returning error: "LoadAnimation requires the Humanoid object (Playername.Humanoid) to be a descendant of the game object"

I’m trying to animate the tool that I made and am using this piece of code here:

local animation = animator:LoadAnimation(script.Parent:WaitForChild('Animation'))
animation.Priority = Enum.AnimationPriority.Action

script.Parent:FindFirstAncestorOfClass("Tool").Activated:Connect(function()
	animation:Play()
end)

But get the following error:
image

I have based all this animation code off of the documentation and as far as I known Nothing here is depricated and is probably still supported.

Getting error “LoadAnimation requires the Humanoid object to be a descendant of the game object” despite waiting for Character - Bug Reports / Studio Bugs - DevForum | Roblox

Just ran into this. Short version, the humanoid/character is loaded but not parented. Calling the function too fast. The solution in this link worked for me.