From trigger storms to targeted queries
Slightly overlapping procedural paving elements caused PhysX to spend excessive time dispatching trigger events. In a representative worst-case trace, physics reached 104 ms and generated very large temporary allocations.
- I replaced unnecessary trigger interactions with targeted Physics.OverlapBox queries for player detection.
- I adjusted Unity's Layer Collision Matrix so floor elements no longer evaluated collisions against one another.
- The measured physics cost fell below 0.1 ms in the optimized case.
