Version: 2021.2
Physics Profiler module
Rendering Profiler module

2D Physics Profiler module

The 2D Physics ProfilerA window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating, or in your game logic. More info
See in Glossary
module displays information about the 2D physics that the physics engineA system that simulates aspects of physical systems so that objects can accelerate correctly and be affected by collisions, gravity and other forces. More info
See in Glossary
has processed in your 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
. This information can help you diagnose and resolve performance issues or unexpected discrepancies related to the 2D physics in your Scene.

2D Physics Profiler module
2D Physics Profiler module

Chart categories

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 scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
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 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
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 detectionA collision detection method that calculates and resolves collisions based on the pose of objects at the end of each physics simulation step. More info
See in Glossary
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 detectionA collision detection method that calculates and resolves collisions over the entire physics simulation step. This can prevent fast-moving objects from tunnelling through walls during a simulation step. More info
See in Glossary
mode.

Module details pane

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.
JointsA physics component allowing a dynamic connection between Rigidbody components, usually allowing some degree of movement such as a hinge. More info
See in Glossary
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.
Physics Profiler module
Rendering Profiler module
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961