The 2D Physics Profiler module displays information about the 2D physics that the physics engine has processed in your Scene. This information can help you diagnose and resolve performance issues or unexpected discrepancies related to the 2D physics in your Scene.
The 2D Physics Profiler module’s chart is divided into nine categories. To change the order of the categories in the chart, you can drag and drop them in the chart’s legend. You can also click a category’s colored legend to toggle its display.
Chart | Description |
---|---|
Total Bodies | Total number of Rigidbody2Ds in the Scene |
Active Bodies | Total number of active Rigidbody2Ds in the Scene. |
Sleeping Bodies | Total number of sleeping Rigidbody2Ds in the Scene |
Dynamic Bodies | Total number of dynamic Rigidbody2Ds in the Scene. A dynamic Rigidbody2D is the most interactive type of Rigidbody2D. Gravity and forces affect it, and is the most resource intensive. |
Kinematic Bodies | Total number of kinematic Rigidbody2Ds in the Scene. A kinematic Rigidbody2D is designed to move under simulation: gravity and forces do not affect this type of Rigidbody2D, and you need to use scripts to control how it behaves. |
Static Bodies | Total number of static Rigidbody2Ds in the Scene. A static body does not move under simulation and is the least resource-intensive type of Rigidbody2D. |
Contacts | Total number of contacts. A contact is a pair of Colliders that either touch or overlap. To solve contacts that overlap, the physics engine applies impulses to keep them touching but not overlapping. |
Discrete Island Count | Total number of discrete islands. The physics engine groups contacts into islands, which it then solves. A contact island is made up of contacts that are connected together, but they do not connect via static Rigidbody2Ds, which act as a cut-off. A discrete island is made up of Rigidbody2Ds that use the discrete collision detection mode. If you use the multi-threaded physics option, too many contact islands are bad for performance because the physics engine solves each island as a job. |
Continuous Island Count | Total number of continuous islands. This is identical to Discrete Island Count except that it only applies to Rigidbody2Ds that use the Continuous collision detection mode. |
When you select the 2D Physics Profiler module, the details pane below it displays a breakdown of where your application spent time on 2D physics in the selected frame. In addition to a more detailed breakdown of the chart categories listed in the previous table, there is the following additional information:
Data | Description |
---|---|
Discrete Bodies | The number of Rigidbody2Ds that use the Discrete collision detection mode. |
Continuous Bodies | The number of Rigidbody2Ds that use the Continuous collision detection mode. |
Joints | The number of Joint2Ds in the Scene. |
Static Shapes | The number of static shapes in the Scene. A shape is a primitive shape that the 2D physics engine creates. A Collider2D might produce single primitive shapes, or multiple primitive shapes. To see the shape count of a Collider2D, you can either look in the Inspector, or use Collider2D.shapeCount in a script. A static shape is one that is attached to a static Rigidbody2D. Static shapes are typically used for non-moving physics geometry such as platforms. |
Active Shapes | The number of active shapes in the Scene. An active shape is a shape attached to a Rigidbody2D that is not sleeping. Static shapes are always inactive because a Static Rigidbody2D is always asleep. |
Sleeping Shapes | The number of sleeping shapes in the Scene. A sleeping shape is a shape that’s attached to a Rigidbody2D that is sleeping. It is the opposite of an active shape. |