I have tried everything I can think of so if anyone can help me I would be grateful
First, when making your animation, make sure it has the loop setting on so it plays continuously.
Instructions:
Place a server script inside of your NPC model
Inside of that server script, place an animation and set the animation ID
Now enter this code into the server script:
local humanoid = script.Parent:WaitForChild("Humanoid") local animation = script.Animation -- Place Animation with set AnimationID inside of the script local playanimation = humanoid:LoadAnimation(animation) playanimation:Play()
If anything goes wrong please let me know.
Hope this helped!
When making a animation after you saved it click on the animation and click Looped
When using loops in animations it isn't required to use the Animation Editor. You can also use basic code for it.
local character = script.Parent local humanoid = character:WaitForChild("Humanoid") local animator = humanoid:WaitForChild("Animator") --You should also use Animator in the Humanoid as LoadAnimation is deprecated on the Humanoid Itself for FE Patch. local Anim = animator:LoadAnimation(AnimationPath) Anim.Looped = true Anim:play()