Roblox LoadAnimation requires the Humanoid object to be a descendant of the game object?

Hey there,

I’ve ran into this issue when a player dies/resets that causes the script to break showing an error.

Error Message:

LoadAnimation requires the Humanoid object (Aozwel.Humanoid) to be a descendant of the game object

Thanks,

1 Like

This is probably happening because the humanoid hasn’t replicated from the server to the client yet. Try doing this before calling LoadAnimation()

local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
1 Like

Whenever the player dies, their humanoid becomes locked to nil. The error is saying that the humanoid needs to be a descendant of workspace to play animations.

Also what @wc3u said.

To combat this, check if the player died and hook whatever system you’re using to their new humanoid.

1 Like