Running animations for NPC through the Camera

Ye nah it only ever runs the idle animation. Still nothing happens however. No errors in the output

function LoadIdleAnimation(humanoid)
	print(1)
	
	
	local animations = script:GetChildren()
	
local animation = animations[math.random(#animations)]
if not animation then return end 

	print(2)
local animTrack = humanoid:LoadAnimation(animation)
animTrack.Stopped:Connect(function() LoadIdleAnimation() end)
	print(3)
animTrack:Play()
end

It prints the 1 2 3 then nothing after. Still not animation playing however. Added the Instance.new() as well, and still getting nothing :confused:

Super weird. Have you tried using another NPC, maybe one of the dummies generated by the Animations plugin?

Yea, theyre all generated by that plugin

Having a look now, I must have removed the HumanoidRootPart (would this affect anything??)

Ooh. Yeah, that’s an important part. If you’re missing that, I’m pretty sure it all breaks.

I’d regenerate your NPC’s and try again.

Edit: Well, I tested. It makes them look stupid, but it doesn’t break the entire animation. Regardless, you should have the HumanoidRootPart there at all times. It could be your problem, but I’m not sure. I’m not really sure how to help much more than this, sorry. :frowning:

All good, thanks for your help :slight_smile:

Still aint working with a fresh dummy. I didnt make the animations tho, they are just animation bundles from roblox, but they are R15 animations, so I thought that might be the problem, but no :confused:

Ill keep messing with it I guess

Upon further testing. The script needs to be Server Side. I tested it with a dummy being already in the workspace, and it worked fine. However, when the dummy is taken from repstore to workspace it doesnt work,

You can run animations locally too so you must be doing something wrong.