# This file is automatically generated. Please don't edit it manually. # To submit a bug report on the content, see # https://devforum.roblox.com/c/bug-reports/documentation-issues/72 name: AnimationController type: class memory_category: Animation summary: | Allows animations to be loaded and applied to a character or model in place of a `Class.Humanoid`. description: | An object which allows animations to be loaded and applied to a character or model in place of a `Class.Humanoid`. Creates an `Class.Animator` and loads animations to update `Class.Motor6D|Motor6Ds` of said character to react in the way that is described within the animation asset referenced by an `Class.Animation` object. Note that the `Class.AnimationController:LoadAnimation()|LoadAnimation()` method of this class has been deprecated. Instead, you should call `Class.Animator:LoadAnimation()` directly from an `Class.Animator` which can be created manually in Studio and directly referenced in scripts. When the deprecated method is called from an `Class.AnimationController`, the controller itself does nothing regarding the animation intended to be loaded, except to automatically generate an `Class.Animator`, onto which the loading call and animation ID are transferred. In this way, the `Class.AnimationController` can be thought of as nothing more than an empty shell for a child `Class.Animator` object which handles any actual functionality regarding animations. code_samples: - AnimationController inherits: - Instance descendants: [] tags: [] deprecation_message: '' properties: [] methods: - name: AnimationController:GetPlayingAnimationTracks summary: | Returns an array of all `Class.AnimationTrack|AnimationTracks` that are currently being played by the `Class.AnimationController`. description: | Returns an array of all `Class.AnimationTrack|AnimationTracks` that are currently being played by the `Class.AnimationController`. A typical use for this function is stopping currently playing tracks using `Class.AnimationTrack:Stop()`. Note this function will not return `Class.AnimationTrack|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) ``` code_samples: - GetPlayingAnimationTracks parameters: [] returns: - type: Array summary: | An array of playing `Class.AnimationTrack|AnimationTracks`. tags: - Deprecated deprecation_message: '' security: None thread_safety: Unsafe capabilities: - Animation - name: AnimationController:LoadAnimation summary: | Loads an `Class.Animation` onto an `Class.AnimationController`, returning an `Class.AnimationTrack` that can be used for playback. description: | This function loads an `Class.Animation` onto an `Class.AnimationController`, returning an `Class.AnimationTrack` that can be used for playback. code_samples: - AnimationController parameters: - name: animation type: Animation default: summary: | The `Class.Animation` to be used. returns: - type: AnimationTrack summary: '' tags: - Deprecated deprecation_message: | This function is deprecated in favor of using `Class.Animator:LoadAnimation()` directly (the `Class.Animator` may be created while editing or at runtime). security: None thread_safety: Unsafe capabilities: - Animation events: - name: AnimationController.AnimationPlayed summary: | Fires whenever the `Class.AnimationController` begins playing an animation. It returns the `Class.AnimationTrack` playing. description: | This event fires whenever the `Class.AnimationController` begins playing an animation. It returns the `Class.AnimationTrack` playing. The `Class.AnimationTrack` can be used to access the animation's playback functions and events. It will only fire for animations playing on the specific `Class.AnimationController`. See `Class.Humanoid.AnimationPlayed` for the `Class.Humanoid` variant of this function. code_samples: [] parameters: - name: animationTrack type: AnimationTrack default: summary: | The `Class.AnimationTrack` that was played. tags: - Deprecated deprecation_message: '' security: None capabilities: - Animation callbacks: []