AnimationController
Allows animations to be loaded and applied to a character or model in place of a Humanoid.
Memory category | Animation |
---|
Member index 3
Description
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.
History 22
- 553 Change PreferredDescriptor of AnimationPlayed from to AnimationPlayed
- 553 Change PreferredDescriptor of LoadAnimation from to LoadAnimation
- 553 Change PreferredDescriptor of GetPlayingAnimationTracks from to GetPlayingAnimationTracks
- 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 LoadAnimation from to Unsafe
- 462 Change ThreadSafety of GetPlayingAnimationTracks from to Unsafe
- 454 Change Tags of AnimationPlayed from [] to [Deprecated]
- 454 Change Tags of LoadAnimation from [] to [Deprecated]
- 454 Change Tags of GetPlayingAnimationTracks from [] to [Deprecated]
- 452 Change Tags of AnimationPlayed from [Deprecated] to []
- 452 Change Tags of LoadAnimation from [Deprecated] to []
- 452 Change Tags of GetPlayingAnimationTracks from [Deprecated] to []
- 453 Change Tags of AnimationPlayed from [] to [Deprecated]
- 453 Change Tags of LoadAnimation from [] to [Deprecated]
- 453 Change Tags of GetPlayingAnimationTracks from [] to [Deprecated]
- 205 Add GetPlayingAnimationTracks
- 204 Add AnimationPlayed
- 130 Add LoadAnimation
- 130 Add AnimationController
Members 3
AnimationPlayed
Parameters (1) | |
---|---|
animationTrack | AnimationTrack |
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.
Thread safety | Unsafe |
---|
History 7
- 553 Change PreferredDescriptor of AnimationPlayed from to AnimationPlayed
- 486 Change Parameters of AnimationPlayed from (animationTrack: Instance) to (animationTrack: AnimationTrack)
- 462 Change ThreadSafety of AnimationPlayed from to Unsafe
- 454 Change Tags of AnimationPlayed from [] to [Deprecated]
- 452 Change Tags of AnimationPlayed from [Deprecated] to []
- 453 Change Tags of AnimationPlayed from [] to [Deprecated]
- 204 Add AnimationPlayed
GetPlayingAnimationTracks
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
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:
local animationTracks = {}
local track = animationController:LoadTrack(animation)
table.insert(animationTracks, track)
Thread safety | Unsafe |
---|
History 6
- 553 Change PreferredDescriptor of GetPlayingAnimationTracks from to GetPlayingAnimationTracks
- 462 Change ThreadSafety of GetPlayingAnimationTracks from to Unsafe
- 454 Change Tags of GetPlayingAnimationTracks from [] to [Deprecated]
- 452 Change Tags of GetPlayingAnimationTracks from [Deprecated] to []
- 453 Change Tags of GetPlayingAnimationTracks from [] to [Deprecated]
- 205 Add GetPlayingAnimationTracks
LoadAnimation
Parameters (1) | ||
---|---|---|
animation | Animation | |
Returns (1) | ||
AnimationTrack |
This function loads an Animation onto an AnimationController, returning an AnimationTrack that can be used for playback.
Thread safety | Unsafe |
---|
History 8
- 553 Change PreferredDescriptor of LoadAnimation from to LoadAnimation
- 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
- 454 Change Tags of LoadAnimation from [] to [Deprecated]
- 452 Change Tags of LoadAnimation from [Deprecated] to []
- 453 Change Tags of LoadAnimation from [] to [Deprecated]
- 130 Add LoadAnimation