Class
AnimationController
Allows animations to be loaded and applied to a character or model in place of
a Humanoid.
An object which allows animations to be loaded and applied to a character or
model in place of a Humanoid. Creates an Animator and loads
animations to update Motor6Ds of said character to react in
the way that is described within the animation asset referenced by an
Animation object.
Note that the LoadAnimation()
method of this class has been deprecated. Instead, you should call
Animator:LoadAnimation() directly from an Animator which can
be created manually in Studio and directly referenced in scripts. When the
deprecated method is called from an AnimationController, the
controller itself does nothing regarding the animation intended to be loaded,
except to automatically generate an Animator, onto which the loading
call and animation ID are transferred. In this way, the
AnimationController can be thought of as nothing more than an empty
shell for a child Animator object which handles any actual
functionality regarding animations.
Methods 2#
| GetPlayingAnimationTracks | Returns an array of all AnimationTracks that are
currently being played by the AnimationController. |
| LoadAnimation | Loads an Animation onto an AnimationController, returning
an AnimationTrack that can be used for playback.Deprecated |
GetPlayingAnimationTracks(): Array#
Deprecated
Returns an array of all AnimationTracks that are
currently being played by the AnimationController.
A typical use for this function is stopping currently playing tracks using
AnimationTrack:Stop().
Note this function will not return AnimationTracks
that have loaded but are not playing. If the developer wishes to track
these they will need to index them manually. See below for one example of
how this could be achieved:
Returns
Array— An array of playingAnimationTracks.
LoadAnimation(animation: Animation): AnimationTrack#
DeprecatedDeprecated
Deprecated. This function is deprecated in favor of using
Animator:LoadAnimation() directly (the Animator may be
created while editing or at runtime).
This function loads an Animation onto an
AnimationController, returning an AnimationTrack that can
be used for playback.
Returns
Events 1#
| AnimationPlayed | Fires whenever the AnimationController begins playing an
animation. It returns the AnimationTrack playing. |
AnimationPlayed(animationTrack: AnimationTrack)#
Deprecated
This event fires whenever the AnimationController begins playing
an animation. It returns the AnimationTrack playing.
The AnimationTrack can be used to access the animation's playback
functions and events. It will only fire for animations playing on the
specific AnimationController.
See Humanoid.AnimationPlayed for the Humanoid variant of
this function.
| Name | Type | Default | Description |
|---|---|---|---|
animationTrack | AnimationTrack | The AnimationTrack that was played. |
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild