Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Animator

Responsible for the playback and replication of Animations.

Member index 95

HistoryMember
680EvaluationThrottled: bool
553PreferLodEnabled: bool
705RootMotion: CFrame
596RootMotionWeight: float
573ApplyJointVelocities(motors: Variant): null
462GetPlayingAnimationTracks(): Array
540GetPlayingAnimationTracksCoreScript(): Array
486LoadAnimation(animation: Animation): AnimationTrack
540LoadAnimationCoreScript(animation: Animation): AnimationTrack
528LoadStreamAnimation(animation: TrackerStreamAnimation): AnimationStreamTrack
569LoadStreamAnimationForSelfieView_deprecated(animation: TrackerStreamAnimation, player: Player): AnimationStreamTrack
637LoadStreamAnimationV2(animation: TrackerStreamAnimation, player: Player = Player, shouldLookupPlayer: bool = true, shouldReplicate: bool = true): AnimationStreamTrack
591RegisterEvaluationParallelCallback(callback: Function): null
573StepAnimations(deltaTime: float): null
690StepAnimationsInternal(deltaTime: float, options: Dictionary): null
607SynchronizeWith(otherAnimator: Animator): null
486AnimationPlayed(animationTrack: AnimationTrack)
540AnimationPlayedCoreScript(animationTrack: AnimationTrack)
551AnimationStreamTrackPlayed(animationTrack: AnimationStreamTrack)
inherited from Instance
553Archivable: bool
670Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
702PredictionMode: PredictionMode
670Sandboxed: bool
680UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 2

HistoryMember

Description

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.

History 117

Members 95

AnimationPlayed

Parameters (1)
animationTrackAnimationTrack

Fires for all AnimationTrack:Play() calls on AnimationTracks created and owned by the Animator.

History 3

AnimationPlayedCoreScript

Parameters (1)
animationTrackAnimationTrack

History 1

AnimationStreamTrackPlayed

Parameters (1)
animationTrackAnimationStreamTrack

History 1

ApplyJointVelocities

Parameters (1)
motorsVariant
Returns (1)
null

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.

History 3

EvaluationThrottled

TypeDefault
boolfalse
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

GetPlayingAnimationTracks

Parameters (0)
No parameters.
Returns (1)
Array

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.

History 2

GetPlayingAnimationTracksCoreScript

Parameters (0)
No parameters.
Returns (1)
Array

History 1

LoadAnimation

Parameters (1)
animationAnimation
Returns (1)
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.

History 4

LoadAnimationCoreScript

Parameters (1)
animationAnimation
Returns (1)
AnimationTrack

History 1

LoadStreamAnimation

Parameters (1)
animationTrackerStreamAnimation
Returns (1)
AnimationStreamTrack

History 1

LoadStreamAnimationForSelfieView_deprecated

Parameters (2)
animationTrackerStreamAnimation
playerPlayer
Returns (1)
AnimationStreamTrack

History 1

LoadStreamAnimationV2

Parameters (4)Default
animationTrackerStreamAnimation
playerPlayerPlayer
shouldLookupPlayerbooltrue
shouldReplicatebooltrue
Returns (1)
AnimationStreamTrack

History 1

PreferLodEnabled

TypeDefault
booltrue

History 2

RegisterEvaluationParallelCallback

Parameters (1)
callbackFunction
Returns (1)
null

History 1

RootMotion

TypeDefault
CFrame0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.
This property is not browsable. It is not visible in Studio's object browser.

History 4

Tags: [ReadOnly, NotReplicated, NotBrowsable]

RootMotionWeight

TypeDefault
float0
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.
This property is not browsable. It is not visible in Studio's object browser.

History 1

Tags: [ReadOnly, NotReplicated, NotBrowsable]

StepAnimations

Parameters (1)
deltaTimefloat
Returns (1)
null

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).

History 3

StepAnimationsInternal

Parameters (2)
deltaTimefloat
optionsDictionary
Returns (1)
null

History 1

SynchronizeWith

Parameters (1)
otherAnimatorAnimator
Returns (1)
null

History 1

Removed members 2

Settings