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
loaded:Play()
sometimes the animation is playing once and then stops but sometimes its just not playing.
What should I change?
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 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!
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: