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()

1 comment
I figured out how to fix by making it a local script. Looping is a local function and will not effect anyone besides the server because it is a local function. Create local script and loop it there.