Why not add a function to get current playing animation clip

AT.
I think it’s easy to implement.
We need this method to find out and pause the playing clip. And maybe unity need to add a pause method too.

1 Answer

1

Well the official answer is that, since there can be multiple animations playing on the same gameobject at the same time… you don’t get to know which ones are playing. Yeah it’s absurd.

To go around this ludicrous shortcoming, you can:

1- test [Animation.isPlaying][1] for a specific animation name,
2- cycle through the full animations array and check isPlaying
3- create a list or array where you push the animations you play for that gameobject, and cycle through that one

Not like having a pre made function, but you can get the job done with these three options.

Oh. I just dont know we can loop though animation like an array. The reference dose not mention that. But I still think a pause function is necessary that will reduce a lot of work. Thanks.

–

You can disable the animation component.

–