I recently learnt that Humanoid:LoadAnimation() is depreciated and I should be using an object called an animator. I have a few questions about it. Like do I need one animator to load all my animations?
What must it be a descendent of for client side and server side animations? Also how will I completely stop an animation track when using animators?
I suggest reading the Roblox API for Animations. There they explain:
To play an animation on a rig containing a Humanoid object, such as typical playable characters, follow this basic pattern:
- Ensure that the local player’s Humanoid contains an Animator object.
- Create a new Animation instance with the proper AnimationId.
- Load the animation via Animator:LoadAnimation() to create an AnimationTrack.
- Play the track with AnimationTrack:Play().
1 Like
Must each player have their own set of animations or can I have one fodler in rep storage with all my animations and load them for each character?
It is most likely very inefficient to have a separate Animator
instance for every animation you have. Alternatively, you can make a table containing all your AnimationID
s. When wanting to play an animation, you can change the AnimationID
in the Animator
to the selected animation, load the animation and then play it.
1 Like