This page contains some tips to help you obtain the best performance from Unity’s animation system, covering character setup, the animation system and run-time optimizations.
In some cases you need to create characters with a large number of bones: for example, when you want a lot of customizable attachments. These extra bones increase the size of the build, and may have a relative processing cost for each additional bone. For example, 15 additional bones on a rig that already has 30 bones takes 50% longer to solve in Generic mode. Note that you can have additional bones for Generic and Humanoid types. When you have no animations playing using the additional bones, the processing cost should be negligible. This cost is even lower if their attachments are non-existent or hidden.
Combine skinned meshes whenever possible. Splitting a character into two Skinned Mesh Renderers reduces performance. It’s better if your character has just one Material, but there are some cases when you might require more than one.
Playing a single Animation ClipAnimation data that can be used for animated characters or simple animations. It is a simple “unit” piece of motion, such as (one specific instance of) “Idle”, “Walk” or “Run”. More info
See in Glossary with no blending can make Unity slower than the legacy animation system. The old system is very direct, sampling the curve and directly writing into the transform. Unity’s current animation system has temporary buffers it uses for blending, and there is additional copying of the sampled curve and other data. The current system layout is optimized for animation blending and more complex setups.
Animating scale curves is more expensive than animating translation and rotation curves. To improve performance, avoid scale animations.
Note: This does not apply to constant curves (curves that have the same value for the length of the animation clip). Constant curves are optimized, and are less expensive that normal curves. Constant curves that have the same values as the default sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary values do not write to the scene every frame.
Most of the time Unity is evaluating animations, and keeps the overhead for animation layersAn Animation Layer contains an Animation State Machine that controls animations of a model or part of it. An example of this is if you have a full-body layer for walking or jumping and a higher layer for upper-body motions such as throwing an object or shooting. The higher layers take precedence for the body parts they control. More info
See in Glossary and Animation State MachinesA graph within an Animator Controller that controls the interaction of Animation States. Each state references an Animation Blend Tree or a single Animation Clip. More info
See in Glossary to the minimum. The cost of adding another layer to the animator, synchronized or not, depends on what animations and blend trees are played by the layer. When the weight of the layer is zero, Unity skips the layer update.
These are tips to help you decide between these types:
There are many optimizations that can be made, some useful tips include:
Always optimize animations by setting the animators’s Culling Mode to Based on Renderers, and disable the skinned mesh renderer’s Update When Offscreen property. This saves Unity from updating animations when the character is not visible.
2018–04–25 Page amended with limited editorial review
2017–05–16 Page amended with no editorial review
Did you find this page useful? Please give it a rating: