This is pretty much a game breaking bug

So normally, I play my game inside of studio and everything works fine. But if I die somehow, the next thing I know, none of my animations work. I think for some reason the humanoid gets destroyed, but I’ve put wait functions and other stuff. Here is the syntax error:

 11:31:37.092  LoadAnimation requires the Humanoid object (goony83.Humanoid) to be a descendant of the game object  -  Client - Running:10

I would appreciate help, thanks.

1 Like

What does your code look like? This error could also occur if the humanoid isn’t a descendant to workspace or WorldModel.

Look in your player character in the explorer while in test mode. Do you still have your humanoid?

I think it is more with the game than a certain script to be honest. I will give you an example anyway tho
(This is part of the script, not all of it) Also I want to mention that it works completely fine until I die

local hum = char:WaitForChild("Humanoid")
local value = game:GetService("ReplicatedStorage").Values.Running
local jeep = workspace.CabinRetreat.Jeep1
local jeep2 = workspace.CabinRetreat.Jeep
local anim = hum:LoadAnimation(anims)


UIS.InputBegan:Connect(function(input,isTyping)
	if isTyping then 
		return
	elseif input.KeyCode == Enum.KeyCode.LeftShift then
		if value.Value == true then
			hum.WalkSpeed = 30
			if not hum.Sit then
			anim:Play()
			
			end
		end
	end
end)
1 Like

Yes, the humanoid is there the entire time

Is the script parented to a service like ReplicatedFirst or StarterPlayerScripts? The script is trying to load the animation on the previous humanoid (now destroyed).


If it isn’t, then you could try to make a function to make the event forcefully get the humanoid:

local function getHumanoid()
   return char:FindFirstChildOfClass("Humanoid")
end

This would return nil if the humanoid doesn’t exist.

Try this script so that it check if the humanoid is here or its still alive:

local hum = char:WaitForChild("Humanoid")
local value = game:GetService("ReplicatedStorage").Values.Running
local jeep = workspace.CabinRetreat.Jeep1
local jeep2 = workspace.CabinRetreat.Jeep
local anim = hum:LoadAnimation(anims)


UIS.InputBegan:Connect(function(input,isTyping)
	if isTyping then 
		return
     end
	if input.KeyCode == Enum.KeyCode.LeftShift then
           if hum ~= nil or hum.Health > 0 then
		if value.Value == true then
			hum.WalkSpeed = 30
			if not hum.Sit then
			anim:Play()
			end
		end
	end
end)

Also I would suggest don’t use the hum ~= nil try using if char:FindFirstChildWhichIsA("Humanoid") then end

It returns nil as you said. What should I do from here?

You could try to print the children of char using:

print(char:GetChildren())

to see all of it’s children and if the humanoid exists. Or try to see if there’s any scripts that interact with the humanoid. Mainly just normal debugging from this point

It returns a table with nothing in it: {}

Weird, the char variable might be having it’s children being removed by something. You could try redefining the variable whenever your character dies

The only thing it can find is the humanoid after I put this in

repeat wait() until char ~= nil

ok I made a for i,v loop and printed v, and now it is showing everything that it should

1 Like

But I still have no clue what the problem is

This is indeed really strange. However, I unfortunately don’t have the answer or solution.

i added this

while char.Parent == nil do
	char.AncestryChanged:Wait()

this makes the error not pop up anymore, but it still doesnt fix it

Maybe its because its trying to find the char or humanoid through the client instead of the server

Hello! Did you try putting the script in StarterPlayer > StarterCharacterScripts? This will run the script every time the character is loaded. You’ll still get the error unless you use a pcall function but it will still run like it’s supposed to.

1 Like

trying this rn, ill let you know if it works

THANK YOU SO MUCH! This worked completely well and there are now no errors whatsoever! I appreciate it a lot, my game has kind of a deadline and I needed to fix this error ASAP