Animator
Responsible for the playback and replication of Animations.
Memory category | Instances |
---|
Member index 24
Description
The main class responsible for the playback and replication of Animations. All replication of playing AnimationTracks is handled through the Animator instance.
See also Animation Editor and Using Animations to learn how to create and add pre-built or custom animations to your game.
History 38
- 645 Change Parameters of from (animation: Content, playState: bool, fadeTime: float, weight: float, speed: float, timePosition: float, priority: AnimationPriority, valuesUpdated: int) to (animation: ContentId, playState: bool, fadeTime: float, weight: float, speed: float, timePosition: float, priority: AnimationPriority, valuesUpdated: int)
- 645 Change Parameters of from (animation: Content, playState: bool, fadeTime: float, weight: float, speed: float, timePosition: float, priority: AnimationPriority, looping: bool, valuesUpdated: int) to (animation: ContentId, playState: bool, fadeTime: float, weight: float, speed: float, timePosition: float, priority: AnimationPriority, looping: bool, valuesUpdated: int)
- 637 Add LoadStreamAnimationV2
- 637 Add
- 617 Add
- 607 Add SynchronizeWith
- 596 Add RootMotionWeight
- 596 Add RootMotion
- 595 Add
- 591 Add RegisterEvaluationParallelCallback
- 573 Change ReturnType of StepAnimations from void to null
- 573 Change ReturnType of ApplyJointVelocities from void to null
- 569 Add LoadStreamAnimationForSelfieView_deprecated
- 567 Add
- 566 Add EvaluationThrottled
- 561 Add
- 553 Add
- 553 Change Default of PreferLodEnabled from to true
- 551 Add AnimationStreamTrackPlayed
- 547 Add PreferLodEnabled
- 540 Add AnimationPlayedCoreScript
- 540 Add LoadAnimationCoreScript
- 540 Add GetPlayingAnimationTracksCoreScript
- 528 Add LoadStreamAnimation
- 486 Change Parameters of AnimationPlayed from (animationTrack: Instance) to (animationTrack: AnimationTrack)
- 486 Change ReturnType of LoadAnimation from Instance to AnimationTrack
- 486 Change Parameters of LoadAnimation from (animation: Instance) to (animation: Animation)
- 462 Change ThreadSafety of AnimationPlayed from to Unsafe
- 462 Change ThreadSafety of StepAnimations from to Unsafe
- 462 Change ThreadSafety of LoadAnimation from to Unsafe
- 462 Change ThreadSafety of GetPlayingAnimationTracks from to Unsafe
- 462 Change ThreadSafety of ApplyJointVelocities from to Unsafe
- 423 Add ApplyJointVelocities
- 408 Add AnimationPlayed
- 408 Add GetPlayingAnimationTracks
- 275 Add StepAnimations
- 47 Add LoadAnimation
- 47 Add Animator
Members 24
AnimationPlayed
Parameters (1) | |
---|---|
animationTrack | AnimationTrack |
Fires for all AnimationTrack:Play() calls on AnimationTracks created and owned by the Animator.
Thread safety | Unsafe |
---|
History 3
- 486 Change Parameters of AnimationPlayed from (animationTrack: Instance) to (animationTrack: AnimationTrack)
- 462 Change ThreadSafety of AnimationPlayed from to Unsafe
- 408 Add AnimationPlayed
AnimationPlayedCoreScript
Parameters (1) | |
---|---|
animationTrack | AnimationTrack |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
AnimationStreamTrackPlayed
Parameters (1) | |
---|---|
animationTrack | AnimationStreamTrack |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
ApplyJointVelocities
Parameters (1) | ||
---|---|---|
motors | Variant | |
Returns (1) | ||
null |
Given the current set of AnimationTracks playing, and their current times and play speeds, compute relative velocities between the parts and apply 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.
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.
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of ApplyJointVelocities from void to null
- 462 Change ThreadSafety of ApplyJointVelocities from to Unsafe
- 423 Add ApplyJointVelocities
EvaluationThrottled
Type | Default | |
---|---|---|
bool | false |
Thread safety | Safe |
---|---|
Category | Behavior |
Loaded/Saved | false |
History 1
GetPlayingAnimationTracks
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Returns the list of currently playing AnimationTracks.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetPlayingAnimationTracks from to Unsafe
- 408 Add GetPlayingAnimationTracks
GetPlayingAnimationTracksCoreScript
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
LoadAnimation
Parameters (1) | ||
---|---|---|
animation | Animation | |
Returns (1) | ||
AnimationTrack |
This function 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 function also loads the animation for the server as well.
You should use this function directly instead of the similarly-named Humanoid:LoadAnimation() and AnimationController:LoadAnimation() functions. These are deprecated proxies of this function which also create an Animator if one does not exist; this can cause replication issues if you are not careful.
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.
Thread safety | Unsafe |
---|
History 4
- 486 Change ReturnType of LoadAnimation from Instance to AnimationTrack
- 486 Change Parameters of LoadAnimation from (animation: Instance) to (animation: Animation)
- 462 Change ThreadSafety of LoadAnimation from to Unsafe
- 47 Add LoadAnimation
LoadAnimationCoreScript
Parameters (1) | ||
---|---|---|
animation | Animation | |
Returns (1) | ||
AnimationTrack |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
LoadStreamAnimation
Parameters (1) | ||
---|---|---|
animation | TrackerStreamAnimation | |
Returns (1) | ||
AnimationStreamTrack |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
LoadStreamAnimationForSelfieView_deprecated
Parameters (2) | ||
---|---|---|
animation | TrackerStreamAnimation | |
player | Player | |
Returns (1) | ||
AnimationStreamTrack |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
LoadStreamAnimationV2
Parameters (4) | Default | |
---|---|---|
animation | TrackerStreamAnimation | |
player | Player | Player |
shouldLookupPlayer | bool | true |
shouldReplicate | bool | true |
Returns (1) | ||
AnimationStreamTrack |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
PreferLodEnabled
Type | Default | |
---|---|---|
bool | true |
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 2
- 553 Change Default of PreferLodEnabled from to true
- 547 Add PreferLodEnabled
RegisterEvaluationParallelCallback
Parameters (1) | ||
---|---|---|
callback | Function | |
Returns (1) | ||
null |
Thread safety | Unsafe |
---|
History 1
RootMotion
Type | Default | |
---|---|---|
CFrame |
Thread safety | Safe |
---|---|
Category | Behavior |
Loaded/Saved | false |
History 1
- 596 Add RootMotion
RootMotionWeight
Type | Default | |
---|---|---|
float | 0 |
Thread safety | Safe |
---|---|
Category | Behavior |
Loaded/Saved | false |
History 1
- 596 Add RootMotionWeight
StepAnimations
Parameters (1) | ||
---|---|---|
deltaTime | float | |
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 function 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).
This function is used to simulate playback of Animations when the game isn't running. This allows animations to be previewed without the consequences of running the game, such as scripts executing. If the function is called while the game is running, or by Scripts or LocalScripts, it will return an error.
Developers designing their own custom animation editors are advised to use this function to preview animations, as it is the method the official Roblox Animation Editor plugin uses.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 573 Change ReturnType of StepAnimations from void to null
- 462 Change ThreadSafety of StepAnimations from to Unsafe
- 275 Add StepAnimations
SynchronizeWith
Parameters (1) | ||
---|---|---|
otherAnimator | Animator | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 607 Add SynchronizeWith