Search Issue Tracker
Fixed in 2022.2.X
Fixed in 2020.3.X, 2021.2.X, 2022.1.X
Votes
0
Found in
2020.3.20f1
Issue ID
1384863
Regression
No
Physics2D.DestroyShapes() has an enormous impact on performances even when very few Physics Shapes Exist
Reproduction steps:
1. Load the attached "TheBibitesDev.zip" project and download the attached "Broken.bb8settings" file.
2. Open the profiler.
3. Hit Play and Click on the Load Simulation Settings (occasionally you cannot click on it so pause/unpause the Editor and try again) and load the "Broken.bb8settings" file.
4. Click on the "Start" button (bottom right).
5. You must wait for a long time (approx 1 minute) for the project to initialize. Ensure the Status panel is on so you can watch the FPS. When it starts updating again then the test has begun.
6. Observe that over 30 seconds to a minute, the FPS will degrade down to a few FPS.
7. Alternately, spin-up the profiler and watch the time "Physics2D.DestroyShapes()" takes getting larger.
Expected result: There will be a gradual reduction however it won't be too severe.
Actual result: There is a sharp drop off in performance as the collider recreated load increases.
NOTE: The scripts shouldn't be doing continual rescaling and due to AutoSyncTransforms being used each query can cause this too so this is a bad code-path to be taking however, the performance impact of it should be improved.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
Resolution Note (fix version 2022.2):
The issue here wasn't the actual recreation of the physics shapes but iterating contacts flagging them that they'll be recreated. This has been made much more efficient.
Improvements available in Unity 2022.2.0a3 and above
Resolution Note (fix version 2022.1):
The issue here wasn't the actual recreation of the physics shapes but iterating contacts flagging them that they'll be recreated. This has been made much more efficient.
Backport fix available on Unity 2022.1.0b5 and above
Resolution Note (fix version 2021.2):
The issue here wasn't the actual recreation of the physics shapes but iterating contacts flagging them that they'll be recreated. This has been made much more efficient.
Resolution Note (fix version 2020.3):
The issue here wasn't the actual recreation of the physics shapes but iterating contacts flagging them that they'll be recreated. This has been made much more efficient.
Backport fix is available on Unity 2020.3.27f1 and above