Optimize physics system performance in the Unity Editor.
Use the guidance in these pages to optimize the physics system so you can maintain your target frame rate and ensure smooth, responsive gameplay. The instructions in these pages address issues identified by Unity Editor diagnostic tools. Before you apply the optimizations described in the documentation in this section and throughout your development, you must be familiar with these diagnostic tools:
Physics.FixedUpdate
and Physics.Simulate
, and in its detailed breakdowns of physics phases such as broad phase and narrow phase processing. To open the Profiler window, go to Window > Analysis > Profiler.RaycastHit
arrays or frequent collisionA collision occurs when the physics engine detects that the colliders of two GameObjects make contact or overlap, when at least one has a Rigidbody component and is in motion. More infoTopic | Description |
---|---|
Optimize the physics system for CPU usage | Optimize Unity’s physics system’s CPU usage by adjusting simulation frequency, managing collidersAn invisible shape that is used to handle physical collisions for an object. A collider doesn’t need to be exactly the same shape as the object’s mesh - a rough approximation is often more efficient and indistinguishable in gameplay. More info See in Glossary, and configuring RigidbodyA component that allows a GameObject to be affected by simulated gravity and other forces. More info See in Glossary components. |
Optimize the physics system for memory usage | Optimize Unity’s physics system’s memory usage by controlling collision callbacks and optimizing physics queries. |