[MODULE SCRIPT] Moon Animator 2 to In Game Animations
Hello Roblox developers,
I’m excited to share a new module I’ve created that extends the functionality of Moon Animator 2 for use in cutscenes. While Moon Animator 2 already allows you to export animations for in-game use, it doesn’t support animating multiple objects or characters simultaneously in a game environment. This is where my module comes in!
Demonstration:
How it looks in plugin ↑
How it looks in game ↑
Features:
Animate multiple objects or characters at once, perfect for creating dynamic and complex cutscenes.
Frame-by-frame control, allowing precise control over animation timing.
Looping and playback management, enabling seamless animation flow.
Simple API to start, stop, update, and reset animations.
API Overview:
Here’s a brief look at the core functions provided by the module:
new(MoonAnimatorAnimation : StringValue, FrameRate : number) -> AnimatorBase – Initializes the animator with a Moon Animator animation and sets the frame rate.
Start() – Starts the animation playback.
Stop() – Stops the animation.
SetFrame(Frame : number) – Moves the animation to a specific frame.
GetFrame() -> Frame : number – Returns the current frame of the animation.
Destroy() – Cleans up the animator once the animation is no longer needed.
Each animation object is fully customizable and supports timelines for property animation, giving developers the ability to manipulate specific properties of objects frame-by-frame.
Why use this?
This module is particularly useful for those creating cinematic cutscenes in Roblox.
Feel free to check it out and let me know what you think! You are free to use/modify it.
I’ve tried to get this working in my game by cross referencing with the Demo place you provided. In short, I’m experience a bunch of problems. I wish it was easier to just play cutscenes, this is all quite frustrating.
StreamingEnabled (even when using Persistent) causes multiple issues with playing the animation / cutscene. Specifically with loading and accessing parts, models, and rigs. Roblox doesn’t seem to load my Rig on my Custom Characters despite the Model being Persistent.
Disabling StreamingEnabled gives me this Expected BasePart got Model for Model.PrimaryPart. from the Util Module. Having a Model as a Model’s PrimaryPart doesn’t make any sense. I suspect the Util is getting Models for things not in the Animation Save from MoonAnimator as all Models I use in my Cutscene have PrimaryParts (a MeshPart specifically w/ a rig under it):
Could you please share your file so I can review it and provide detailed recommendations? Based on my initial observations, there are a couple of points to consider:
You are currently using a folder to contain all your cutscene assets. This approach might lead to issues since you cannot set StreamingBehavior on a folder as you can with a model.
I have not yet tested this workflow with rigged models that include bone constraints, so there may be unanticipated compatibility concerns.
If you’d like to discuss this further, feel free to reach out to me on Discord - doh4x
Edit:
To ensure proper module initialization, it is crucial to wait for all instances within the folder to fully load before proceeding animation. Failure to do so may lead to potential issues. However, an update addressing this concern, including a fix for bone-based rigs, will be released soon.
Streaming Functionality: Full support for streaming is now available. To ensure this feature to work, please combine your animation assets into a single model and set the model ModelStreamingMode to either persistent or atomic.
Enhanced Compatibility: Added support for models utilizing a bone-based structure.