Increasing the performance of the Physics system
Physical simulation requires a lot of calculations, especially in the case of high physical accuracy requirements. Therefore, it is very important to understand how to use Unity's Physics system correctly and reduce unnecessary computing overhead.
The Unity Profiler
First, we should learn how to use tools to view and locate performance bottlenecks caused by the Physics system in Unity.
The Profiler tool in the Unity Editor is our recommended tool, which allows us to easily view various performance data and locate performance issues related to the Physics system.
Taking the ping-pong game we just made as an example, we can perform the following steps to view the performance data of this game:
- Start the game in the editor by clicking the Play button.
- Click Window > Analysis > Profiler or use the keyboard shortcut...