Skip to content

Class · inherits Instance

Animator

Official docs ↗

Responsible for the playback and replication of Animations.

About Animator

Animator is the main class responsible for the playback and replication of Animations. All replication of playing AnimationTracks is handled through the Animator instance.

See Animation in Roblox to learn how to create and add pre-built or custom animations to your game.

Properties 2

  • EvaluationThrottled: booleanReadOnlyNotReplicatedIndicates whether animation evaluation was throttled (skipped) this frame for this Animator.

    A read-only property that indicates whether animation evaluation was throttled (skipped) on this frame. When true, the Animator reused the pose from the previous frame instead of evaluating fresh animation data.

    This property is useful when layering procedural animation on top of Transform — if evaluation was throttled, applying procedural offsets would fight the stale pose and should be skipped:

  • PreferLodEnabled: booleanControls whether animation LOD throttling is allowed for this Animator. When set to false, animations always evaluate at full fidelity.

    When true (the default), the engine may reduce animation evaluation frequency for remotely-simulated characters based on distance, screen coverage, and frame budget. When set to false, LOD-based throttling is disabled and this Animator always evaluates at full fidelity.

    Setting this to false is useful for important NPCs or characters that must always animate smoothly regardless of distance. However, disabling LOD for many animators simultaneously can impact performance.

    Note that this property only controls per-animator LOD throttling. The workspace-level Workspace.ClientAnimatorThrottlingMode setting can independently disable or enable throttling for all animators.

Methods 5

  • ApplyJointVelocities(motors: Variant) → ()Computes relative velocities between parts and applies them to Motor6D.Part1.

    Given the current set of AnimationTracks playing and their current times and play speeds, this method computes relative velocities between the parts and applies them to Motor6D.Part1 (the part which Animator considers the "child" part). These relative velocity calculations and assignments happen in the order provided.

    This method doesn't apply velocities for a given joint if both of the joint's parts are currently part of the same assembly; for example, if they are still connected directly or indirectly by motors or welds.

    Note that this method doesn't disable or remove the joints for you. You must disable or otherwise remove the rigid joints from the assembly before calling this method.

    The given Motor6Ds are not required to be descendants of the DataModel. Removing the joints from the DataModel before calling this method is supported.

  • GetPlayingAnimationTracks() → ArrayReturns the list of currently active AnimationTracks.

    Returns the list of currently active AnimationTracks on this Animator. This includes tracks that are fading out and does not depend on AnimationTrack.IsPlaying being true; as a result, GetTrackByAnimationId() may be a better option to get a specific AnimationTrack by its asset ID. Fading tracks are automatically stopped and removed from this list once their blend weight reaches zero.

  • GetTrackByAnimationId(animationId: ContentId) → AnimationTrack?Returns an existing AnimationTrack on this Animator that was loaded from an Animation with the given animation ID. Unlike LoadAnimation(), this method does not create a new AnimationTrack instance.

    Returns an existing AnimationTrack on this Animator that was loaded from an Animation with the given animation ID. Unlike LoadAnimation(), this method does not create a new AnimationTrack instance; it only looks up a track that was previously loaded.

    If multiple tracks have been loaded for the same animation ID, this method returns the first match. If no matching track exists, it returns nil.

  • LoadAnimation(animation: Animation) → AnimationTrackLoads an Animation onto an Animator, returning an AnimationTrack.

    This method loads the given Animation onto this Animator, returning a playable AnimationTrack. When called on an Animator within models that the client has network ownership of, for example the local player's character or from BasePart.SetNetworkOwner, this method also loads the animation for the server as well.

    Note that the Animator must be in the Workspace before making a call to LoadAnimation() or else it will be unable to retrieve the AnimationClipProvider service and throw an error.

    Warning

    Do not use LoadAnimation() in an attempt to retrieve an existing track. Calling LoadAnimation() always creates a new AnimationTrack instance which may impact game performance if overused. Instead, use GetTrackByAnimationId() when you need to look up a track that was already loaded.

    Loading an Animation on Client or Server

    In order for AnimationTracks to replicate correctly, it's important to know when they should be loaded on the client or on the server:

    • If an Animator is a descendant of a Humanoid or AnimationController in a player's Player.Character, animations started on that player's client will be replicated to the server and other clients.

    • If the Animator is not a descendant of a player character, its animations must be loaded and started on the server to replicate.

    The Animator object must be initially created on the server and replicated to clients for animation replication to work at all. If an Animator is created locally, then AnimationTracks loaded with that Animator will not replicate.

  • StepAnimations(deltaTime: float) → ()Increments the AnimationTrack.TimePosition of all playing AnimationTracks that are loaded onto the Animator, applying the offsets to the model associated with the Animator. For use in the command bar or by plugins only.

    Increments the AnimationTrack.TimePosition of all playing AnimationTracks that are loaded onto the Animator, applying the offsets to the model associated with the Animator. For use in the command bar or by plugins only.

    The deltaTime parameter determines the number of seconds to increment on the animation's progress. Typically this method will be called in a loop to preview the length of an animation (see example).

    Note that once animations have stopped playing, the model's joints will need to be manually reset to their original positions (see example).

    Access

    This method requires Plugin-level security. It can only be called from the Studio command bar or from a Plugin. Regular Script and LocalScript instances cannot call this method.

Events 1

Animator also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.