Physics Core 2D Profiler module reference
Explore the statistics in the Physics Core 2D Profiler module to find how many objects 2D Physics Core simulates and how much time each part of the simulation takes.
Read time 5 minutesLast updated 4 days ago
The Physics Core 2D module in the Profiler window displays the number of physics objects in the 2D Physics Core worlds in your project, the memory the simulation uses, and the time each stage of the simulation step takes.
The module displays data for the frame you select in the chart.
To enable the Profiler module, follow these steps:
- In the main menu, go to Window > Analysis > Profiler.
- Select Profiler Modules, then enable Physics Core 2D.
To collect profiling data, enter Play mode, or build your application with the Profiler attached. For more information, refer to Collecting performance data.
Chart categories
The chart in the Physics Core 2D module displays the following categories. Each value is the total for all the physics worlds in the selected frame.
Chart | Description |
|---|---|
| Total Worlds | Displays the number of physics worlds. The total includes the default world. For more information, refer to Create multiple simulation worlds with 2D Physics Core. |
| Total Bodies | Displays the number of physics bodies. |
| Total Shapes | Displays the number of physics shapes attached to bodies. |
| Total Contacts | Displays the number of contacts between pairs of shapes that are touching or close to touching. |
| Total Joints | Displays the number of constraints that connect bodies. For more information, refer to Introduction to constraints. |
| Total Islands | Displays the number of islands. An island is a group of bodies that contacts or constraints connect, which Unity simulates together. The total includes islands that are asleep. An island falls asleep when every body in the island moves slower than its Sleep Threshold value for 0.5 seconds. Unity doesn't simulate a sleeping island until a collision or force wakes up one of its bodies. For more information, refer to Physics Simulation Definition asset reference. |
| Total Stack Used | Displays the largest amount of temporary stack memory that each world has needed for a simulation step since Unity created the world, added together for all worlds. |
| Total Memory Used | Displays the amount of memory that 2D Physics Core currently allocates. |
| Total Tasks | Displays the number of tasks that Unity splits the simulation step into, to run them on worker threads. For more information, refer to Optimize 2D Physics Core with multithreading. |
Module details pane
The details pane of the Physics Core 2D module contains the Physics Core 2D Statistics panel and the Physics Core 2D Profile Data panel.
Physics Core 2D Statistics
The Physics Core 2D Statistics panel displays the counts and memory use of 2D Physics Core in the selected frame. Each value is the total for all the physics worlds. The panel displays memory values with the unit B, KB, or MB, where 1 KB is 1,024 bytes and 1 MB is 1,024 KB.
To control whether the details pane follows the frame you select, enable the Live Update checkbox in the Physics Core 2D Statistics panel. Live Update is enabled by default.
- When you enable Live Update, both panels display the data for the frame you select in the chart.
- When you disable Live Update, both panels keep the data they currently display, even when you select another frame or Unity records new frames. When you enable Live Update again, both panels display the data for the frame you select.
The Physics Core 2D Statistics panel contains the following properties:
Property | Description |
|---|---|
| Bodies | Displays the number of physics bodies. |
| Shapes | Displays the number of physics shapes attached to bodies. |
| Contacts | Displays the number of contacts between pairs of shapes that are touching or close to touching. |
| Joints | Displays the number of constraints that connect bodies. |
| Islands | Displays the number of islands. The total includes islands that are asleep. |
| Stack Used | Displays the largest amount of temporary stack memory that each world has needed for a simulation step, added together for all worlds. |
| Memory Used | Displays the amount of memory that 2D Physics Core currently allocates. |
| Tasks | Displays the number of tasks that Unity splits the simulation step into, to run them on worker threads. |
| Broadphase Height | Displays the height of the tree that Unity uses to find which shapes on dynamic and kinematic bodies might overlap, added together for all worlds. A higher value means Unity needs more steps to search the tree. |
| Static Broadphase Height | Displays the height of the tree that Unity uses to find which shapes on static bodies might overlap, added together for all worlds. A higher value means Unity needs more steps to search the tree. |
Physics Core 2D Profile Data
The Physics Core 2D Profile Data panel displays a table of the time 2D Physics Core spends on each part of the simulation in the selected frame. The Name column displays the name of each row, and the Time column displays the time in milliseconds (ms).
The time of a row includes the time of the rows beneath it. To expand or collapse a row, select the arrow next to it, or double-click the row. To sort the table, select a column heading.
If the selected frame has no data, the panel displays a message that prompts you to select another frame.
The Physics Core 2D Profile Data panel contains the following property:
Property | Description |
|---|---|
| View By | Sets how the table groups the time. The following options are available:
|