Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity 2017.3.0f3 Performance issue on DirectorUpdateAnimationBegin and DirectorUpdateAnimationEnd

Discussion in 'Animation' started by sunyifeng, Dec 27, 2017.

  1. sunyifeng

    sunyifeng

    Joined:
    Nov 4, 2014
    Posts:
    28
    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:
    upload_2017-12-27_17-35-31.png
    upload_2017-12-27_17-36-13.png

    Has anyone encounted the issue? How can impove the performance of timeline?
     
  2. sunyifeng

    sunyifeng

    Joined:
    Nov 4, 2014
    Posts:
    28
    The update spend a lot of time too:
    upload_2017-12-27_17-47-10.png
     
  3. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    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.
     
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,448
    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.
     
    radiantboy and grover_s like this.