Performance: Blend trees
MEDIUM IMPACT
Blend trees affect the rendering and animation performance by controlling how multiple animations are combined and played smoothly in real-time.
Use a single 2D blend tree combining Speed and Direction parameters Animator.SetFloat("Speed", speed); Animator.SetFloat("Direction", direction);
Animator.SetFloat("Speed", speed); Animator.SetFloat("Direction", direction); // Using many separate animations with frequent state changes
| Pattern | CPU Load | Animation State Changes | Blend Calculations | Verdict |
|---|---|---|---|---|
| Multiple separate animations with frequent state changes | High | Many | Many | [X] Bad |
| Single 2D blend tree combining parameters | Low | Few | Few | [OK] Good |