Dummy humanoids don't have animators?

Infinite yield possible on 'Workspace.Dummies.Dummy.Humanoid:WaitForChild("Animator")'
I get this error for some reason, I’m trying to get everything players and dummies within a certain radius to play an animation.


for i,v in pairs(workspace.Dummies:GetChildren()) do
		if (player.Character.HumanoidRootPart.Position - v.HumanoidRootPart.Position).Magnitude <= 15 then
			table.insert(targets, v)
		end
	end

I get all the characters in the targets table to play the animation but it seems to only work on players.

if u want to play animations using loadanimation use it on humanoids.

nevermind im high, dummy humanoids don’t spawn with animators(i didnt know that) so i fixed it by just manually adding an animator into their humanoid

also didnt loadanimation on humanoids got deprecated?

Some NPCs may not have the Animator instance. For a failsafe, do this.

for i,v in pairs(workspace.Dummies:GetChildren()) do
	if (player.Character.HumanoidRootPart.Position - v.HumanoidRootPart.Position).Magnitude <= 15 then
		if not v.Humanoid:FindFirstChildOfClass("Animator") then
			local animator = Instance.new("Animator")
			animator.Parent = v.Humanoid
		end
		table.insert(targets, v)
	end
end

deprecated doesnt means cant be used

you need to create animators in all the dummy humanoids, and then play the animation


uhh you shouldn’t use humanoid:LoadAnimation() as it’s deprecated and shouldn’t be used for new work

https://create.roblox.com/docs/reference/engine/classes/Humanoid#LoadAnimation