Hi I'm writing this game which requires animations for the npcs. I have stuff where I want the animation to loop forever. I'm not sure why but it only plays once and then stops. If I run it (not like with player. just running it) it works fine. I have a local and non local script that are duplicates and it doesn't do anything.
Code:
local Humanoid = script.Parent:WaitForChild("Humanoid") local animationTrack = Humanoid:LoadAnimation(script.NPCIdle) -- The animation is in the script animationTrack.Looped = true animationTrack:Play()
So if you did turn on looping and it didn't work then a method that I have come to use which works would be something like this.
local Humanoid = script.Parent:WaitForChild("Humanoid") local animationTrack = Humanoid:LoadAnimation(script.NPCIdle) -- The animation is in the script while true do animationTrack:Play() wait(animationTrack.Length) end
That's not the most optimal way of doing it but that will allow it to function. If That does not work for you then I'll make sure to take this answer down.