How to check for a specific animation in the animator?

Hello everyone,

I’m trying to check for a specific animation that is playing in the Humanoid’s animator but I have no idea how to search for them since the array you get from Animator:GetPlayingAnimationTracks() returns an array with Userdata type (which I have no idea how to retrieve)

Any help?

1 Like

You could name the loaded animation, then you could use an if statement to find the name.

GetPlayingAnimationTracks() gives you an array of AnimationTracks. You can get the Animation object from the AnimationTrack by indexing its “Animation” property. The Animation object should then have an “AnimationId” property which you can use to check if an animation with a specific id is playing.

Or if you have the AnimationTracks referenced somewhere (when you loaded them probably), you can just directly compare them.

5 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.