Animation Not Looping

So I’ve been using moon animator to make a small looping animation I want to use for a NPC, but for some reason, the animation would only play once, even though I set looped on true. Can someone please help me fix this small problem? Thank you for reading.

Here’s the code:

1 Like

maybe the problem the animation u made is not looped or is just me dosnt know about this thing

Did you loop the animation with-in the Moon Animator? That can also be the case, and it’s easily forgettable as it’s not a setting you can set to automatic (same goes for the priority of the animation!).

Afterwards just export that animation.

how can i loop the animation in moon animator? I can’t find the settings anywhere

put dance.Looped = true before playing the animation

Two ways:

You can go to Edit > Animation Settings…

OR

You can just press 8 on your numpad, if you have one.

image
image

Thanks a lot! It appears to work perfectly now.

1 Like

Also, just to also say with the script, I believe you should set the Looped to true before playing it. It’s another simple mistake.

local animation = Animation
local humanoid = Humanoid
local dance = humanoid:LoadAnimation(animation)

-- so instead of doing...
dance:Play()
dance.Looped = true -- because you can't modify a playing animation

-- you would do this

dance.Looped = true
dance:Play()

--[[ you actually modify the track BEFORE playing it anyway, this goes with these as well:

dance:AdjustSpeed()
dance:AdjustWeight()

it's okay, we makes mistakes (like I do!). glad I was able to help you though, good luck on your game!
]]