Used Moon Animator to animate model - How do I play the animation for the model?

(I think this is in the right catagory)

Hi. I used the Moon Animator Plugin to animate my model. (Rollercoaster train going around a track) It has a HumanoidRootPart inside, and the only thing that I animated was the base.

The HumanoidRootPart stays in the same place throughout the animation (which it is meant to do) while the ride moves perfectly around.

My question is, how do I play the animation of the model in-game? I have exported it and uploaded it to Roblox and now I just need to play it.

image

(Screenshot of the model)

If there is anymore info you need to know then just ask. Thanks for any support!

1 Like

You need to create an AnimationController and an Animator object, then load the animation onto the Animator object. After that, you can play the animation. AnimationController will allow you to play animations on a non-Humanoid object.

local AnimationController = Instance.new("AnimationController")
local Animator = Instance.new("Animator", AnimationController)
AnimationController.Parent = Rig

This code isn’t consistent in the way it chooses to parent its objects but I just cut out one extra line. The reason I do it this way is because you don’t need to modify any of the properties of these created objects but it’s better to create the children and parent them first before the main object. That’s why the Animator parent can be set directly but AnimationController’s parenting needs to be deferred. This should be in a server script.

I recommend checking out Using Animations in Games and other available resources on the Developer Hub first; you can learn how to create and use animations in your games. These resources are available for you to do some research and make attempts. If you can’t after you’ve tried first, you can ask the Developer Forum for help by posting a thread. :slight_smile:

2 Likes

Awesome! Thanks for the help.

Sorry, didnt think to look on there as I thought it wouldnt have an answer for non-humanoids. I’ll make sure to check everything next time :slight_smile:

Thanks again!

1 Like