Why Is Physics Still Expensive on Low-End Devices Even After Simplifying Collision Models?
Why is Physics still taking 20–30 ms on low end devices even after the collision models have been simplified? https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/90268e41 aba2 47f5 b89c 7df67b33c068.png
Collider complexity is only one factor affecting Physics time. If the Colliders have already been simplified but Physics still takes a significant amount of time, you should also examine the number of dynamic objects being simulated simultaneously and the collision relationships generated between those objects. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/8efd6769 10fd 47e4 8a29 8bd9a724dbe8.png According to the data changes in the GameOptim GOT Online report, Physics time decreases as the number of objects in the scene decreases, while the number of Overlaps also drops significantly. The current scene has already reached several thousand Overlaps, indicating that the physics system needs to maintain a large number of potential collision relationships. The investigation can focus on the following areas: Check whether Physics time is related to the scale of collision relationships. Reduce the number of dynamic objects participating in collisions and observe whether the number of Overlaps and Physics time decrease accordingly. If both metrics show a consistent downward trend, the primary pressure may come from the large number of collision relationships rather than the complexity of individual Colliders. Check the combination of dynamic Rigidbody and Mesh Collider. The scene contains a large number of dynamic objects with , some of which use . For dynamic non Kinematic , needs to use . Where the shape allows, you can further compare the actual performance of , , , or . However, replacing Colliders should ultimately be evaluated through testing in the actual project. A primitive Collider should not simply be assumed to be more efficient in every case. Reduce unnecessary collision detection. If certain objects do not actually need to collide with each other, use the Layer Collision Matrix to disable collisions between the corresponding Layers and reduce unnecessary collision combinations. After making the change, continue monitoring the number of Overlaps and Physics time to evaluate the impact. Check the physics simulation frequency. Unity normally executes physics simulation according to the Fixed Timestep . When a low end device experiences frame drops, multiple physics simulations may need to be processed within a single rendering frame, further increasing Physics time. You can try adjusting the , for example from to , and compare the resulting Physics time and actual physics behavior. In Unity 2022 and later , you can also test the impact of different Physics Simulation Mode settings. For example, switching to Update driven simulation can help evaluate how much performance can be gained by reducing multiple physics simulations within a single frame. However, this approach is affected by actual frame rate fluctuations, so you also need to verify whether collision stability and motion behavior still meet the project's requirements.