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
The NPC you have should already be rigged since it’s automatically rigged (if you got it from rig builder).
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!
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
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:
Set it to idle because that is the animation you are trying to make.
And the animation priority should probably be set as idle.
I did that now and it worked, thank you so much.
I set it to action and it still works, is that fine?
Yes, it’s fine if it works but it’s recommended to use idle for idle animations.
Okay, im just curious, whats the difference?