My custom character's humanoid root part isn't being detected although it's there?

There isn’t much explaining, but it does give me an error saying, “Infinite yield possible on 'WaitForChild(“HumanoidRootPart”) - Studio.” Although it’s there, my scripts don’t detect it still. But this only happens rarely though, not all the time.

Can we see your script please. The full thing if possible

1 Like

humanoid.Changed:Connect(function()
if humanoid.Health == 0 then
if plr.Team == game.Teams.Creepers and plr:FindFirstChild(“Exploding”) then
char.HumanoidRootPart.Anchored = true
end
end
end)

Edit: .Died won’t work I think, but I can test
Another edit: I think it works, but idk if it will work in a public server. I’ll test in a bit, and respond soon

1 Like

More like:

humanoid.Changed:Connect(function()
	if humanoid.Health == 0 then
		if plr.Team == game.Teams.Creepers and plr:FindFirstChild("Exploding") then
			char.HumanoidRootPart.Anchored = true
		end
	end
end)

Can you provide the full script? There’s a lot of code logic (which may help identify the issue) missing here.

It’d be better to replace this line with humanoid:GetPropertyChangedSignal("Health"):Connect(function() as using .Changed would fire the event everytime a property of the humanoid changes, which is just lost performances/decompiling speed.