Humanoid:GetLoadedAnimationTracks()

As a Roblox developer, it is currently impossible to get the loaded animation tracks for a humanoid which are not playing.

If Roblox is able to address this issue, it would improve my development experience because I would easily be able to get an array of the humanoid’s loaded animations without having to previously set these as variables.

Current code:

local PlayingAnimations = this.Humanoid:GetPlayingAnimationTracks()
for _,track in pairs(PlayingAnimations) do
    if track.Name == "RunAnim" then
        warn("Running already...")
        return
    end
end

local runAnim = this.Humanoid:LoadAnimation(Animations.run.RunAnim)
runAnim:Play()

Code with new feature might look like:

local LoadedAnimations = this.Humanoid:GetLoadedAnimationTracks()
if LoadedAnimations.RunAnim.IsPlaying then
    warn("Running already...")
    return
end

LoadedAnimations.RunAnim:Play()
33 Likes

Support. This would be very great for single-player / splitscreen games that want to emulate pausing as if it were its own standalone game.

The option we have now is lacking because if there is an Animator script present and it changes the currently playing animation, there’s no real way to deal with that outside of forking the animator to return all loaded animations, which would force the developer to manually take charge of updating the Animator and reapplying changes if it ever receives an official update.

I’m not one to say this, but I reckon it wouldn’t be a major setback to implement if we’re able to get all playing animations. Maybe we can deprecate PlayingAnimationTracks for LoadedAnimationTracks.

9 Likes