I have testing my project on xiaomi mix2. And i found the performance issues on DirectorUpdateAnimationBegin and DirectorUpdateAnimationEnd. I used a timeline to control the animations of many gameobjects. Maybe it’s the cause of the performance issue.It takes a lot of times in android:
I have the same issue, Animators are just plain slow it seems, I can run thousands of enemies in my game with very little performance hit when they have their Animator components disabled but once they’re enabled I can support maybe 200 at most before high-end systems start dropping below 100fps. 600 enemies with no animators runs at >144fps but with animators it’s closer to 45, over 80% of my frametime is spent on DirectorUpdateAnimationBegin.
It doesn’t look like there’s an answer to this problem either as in Unity’s recent performance talk where they show the massive scene with tens of thousands of interacting AI they all just bob up and down with no actual bone animation.
What I can give as a solution is that if the animations are simple you can create a vertex shader to do it, if not you could try the legacy system for less overhead or do what I did and only allow a certain number of animated objects on screen at once, disabling animators for new objects as they arrive and re-enabling animators as the number of objects falls. I’ve also set mine up to re-enable animators for actions such as being stunned, dying, and other animated effects so the only time the animator is disabled is when the enemy is at idle.
We had a similar issue and it turned out the number exposed Transforms of the skeleton/bone-hierarchy was causing a significant performance drop.
We turned on the Optimize GameObject option and exposed only the Transforms we needed to attach objects. This improved performance significantly in our project.