Unity Performance Optimization: Animation Module

Discussion in 'Game Development (Technical)' started by UWA4d, Jan 29, 2022.

  1. UWA4d

    UWA4d New Member

    Dec 6, 2021
    Likes Received:
    We have explained the performance optimization knowledge points of Unity’s mainstream modules one by one four years ago, commonly known as “Basic Version”. As the engine itself, hardware equipment, production standards, etc. have been upgraded in recent years, UWA has also continued to update optimization rules and methods and continue to output to the majority of developers. As an “upgraded version” of the performance optimization manual, [Unity Performance Optimization Series] will try to express it in a simple and understandable way, so that more developers can use it. In this issue, we will continue to share the knowledge points related to the animation module.



    Currently, in UWA report, we can see that the main functions related to animation include:


    There are two Animator-related functions: one is DirectorUpdateAnimationBegin and the other is DirectorUpdateAnimationEnd. Generally speaking, we must pay attention to the stack of these two functions, and further locate the cause through the number of calls of the stack function and the proportion of time consumed. Common factors affecting performance and optimization countermeasures are as follows:

    1)Control the number of Active Animator

    The number of characters increase will lead to an overall time-consuming increase, and the CPU time of each function increases approximately linearly with the increase of the character data.


    The above picture is a real-device evaluation report of a project. We selected a frame to check its stack information and found that the number of calls to ApplyOnAnimatorMove is up to 168 times, which means the current scene there are 168 Animators in the Update state i, this value is very high. In general, it is recommended to keep it within 30 as much as possible.

    The reason for this high value is usually the CPU time caused by a large number of off-screen Animators that are still updating calculations. It may be caused by the Animator component of the cached character being still in the Active state, or it may be caused by too many Animator components on the UI. For the Animator on the UI, if the animation is relatively simple, it is recommended to try to use Dotween instead.

    Read the full content in the below website:


Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer