Animation on Rig breaks when testing

We have constructed this robot for a future project and decided to give it a simple idle animation. The animation works perfectly until it is time to play/run the game.

Once run, it completely breaks. We have no clue why it’s doing this.

This is the code inside the animation script. I also used moon animator to animate this piece.

In studio:

When testing:
image

image

local hum = script.Parent:WaitForChild("Humanoid")
local loaded = hum:LoadAnimation(script.Animation)
loaded.Looped = true
loaded:Play()
1 Like

Using the proper approach by loading the animation into the Animator makes any difference?

local hum = script.Parent:WaitForChild("Humanoid")
local Animator = hum:WaitForChild("Animator") -- be sure there is an Animator instance in the Humanoid
local loaded = Animator:LoadAnimation(script.Animation)
loaded.Looped = true
loaded:Play()

Thank you, this worked. It was an issue with the humanoid and this fixed it.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.