NPC Idle Animation not working


im not a scripter but someone scripted my an animation script for my NPC idle animation.
The NPC is R6. (Dummy)
I anchored only the HumanoidRootPart, i think thats right?

local ani = script:WaitForChild('Animation')
local hum = script.Parent:WaitForChild('Humanoid')
local loaded = hum:LoadAnimation(ani)
loaded.Looped = true

sometimes the animation is playing once and then stops but sometimes its just not playing.
What should I change?


Can someone help please? I dont know what im doing wrong.

I think you shouldn’t really use the .Looped thing. When making an animation, in the animation editor, there is a button that can let you put it looped. Just click on it and then export it. I think the problem is the animation sometimes doesn’t loop.

I don’t think you need to anchor the HumanoidRootPart because if the npc is rigged, it will stay together even if it is unanchored.
I may be wrong though.

If you don’t want to do it loop it and export it, try this

while wait() do

Alright thanks but I think something with my place is wrong. I took a model from a youtuber which worked in the video but in my place its not working.

How do I know if its rigged? Sorry :smiley:

The NPC you have should already be rigged since it’s automatically rigged (if you got it from rig builder).

1 Like

If there is really something wrong, disable all your plugins in another place and try it there? Some plugins can cause issues if they’re meant to harm. Or there is just a script that can harm your place. Always check for viruses!

1 Like

I don’t think that would be the reason since the script would still work even if there was a virus.

Yea, I was just talking about him saying something in the place is wrong.

Nothing changed when i unanchored it :confused:

To what should i set the animation priority?

If your remaking it or reimporting it, you should also turn on looping for it so you don’t have to use a script to loop it.
Press this to make it loop:

1 Like

Set it to idle because that is the animation you are trying to make.

1 Like

And the animation priority should probably be set as idle.

1 Like

I did that now and it worked, thank you so much.


I set it to action and it still works, is that fine?

1 Like

Yes, it’s fine if it works but it’s recommended to use idle for idle animations.

1 Like

Okay, im just curious, whats the difference?