Course contentsShow
← Unity Game Development
Lesson 377 of 8286. Animation and CinemachineFree lesson

Optimizing Animator Performance and Culling

You will configure culling modes and update rates to maintain high performance when rendering multiple animated characters simultaneously.

In this lesson, you will learn how to boost your game’s frame rate by configuring Animator culling modes to stop unnecessary calculations for off-screen characters.

When you have a crowd of characters running complex state machines, Unity spends precious CPU time calculating bones and root motion even for characters the player cannot see. By default, an Animator continues to update regardless of visibility, which is a major performance bottleneck in scenes with high actor counts.

Configuring Culling Modes

You can manage this behavior via the Culling Mode setting located directly on the Animator component in the Inspector. There are three primary modes:

  • Always Animate: The default behavior. Calculations run regardless of visibility.
  • Cull Update Transforms: If the renderer is not visible, Unity stops updating the internal bone positions and animation state. However, it still updates the Transform component, which is necessary if your character’s position affects other objects or game logic.
  • Cull Completely: This is the most performance-heavy optimization. When the character is off-screen, the Animator stops all processing entirely.

Optimizing Update Rates

For characters that are visible but in the distance, or for background NPCs, you don't always need them to update every single frame. You can use the Animator.updateMode property or the Update Mode setting in the Inspector to decouple animation updates from the rendering frame rate.

If you are using a custom manager script, you can even toggle the Animator.enabled property based on distance from the Main Camera:

void Update() {
    float distance = Vector3.Distance(transform.position, Camera.main.transform.position);
    // Disable Animator for distant background NPCs to save CPU
    animator.enabled = distance < 50f;
}

By combining Cull Completely for off-screen characters with distance-based enabling, you can sustain high performance even when rendering dozens of characters simultaneously. Always profile your game using the Profiler window to ensure that your culling choices are actually reducing the CPU usage of the "Animation" module.

Key Takeaway: Set your Animator's Culling Mode to "Cull Completely" for background characters to stop redundant processing and significantly lower your CPU overhead.