Search Issue Tracker
Not Reproducible
Votes
1
Found in
5.6.2p4
Issue ID
935160
Regression
No
Disabling a parent GameObject that has many children with Rigidbody component is very slow
The issue happens only when the children of the object that is being disabled have a Rigidbody on them. The lag spike reaches up to 120ms. When disabling the children directly, lag spike is ~16ms, but still way more than when the objects have no Rigidbody component
To reproduce:
1. Open the project, attached by the tester (disableLag.zip)
2. Open the "scene" scene
3. Open the Profiler
4. Enter Play mode
5. While focused on Game view, press Space to disable objects
6. Observe the blue spike that appears in the Profiler
Expected: disabling an object with children who have Rigidbody components on them doesn't cause enormous lag spikes
Reproduced in 5.4.5p4, 5.5.4p2, 5.6.2p4, 5.6.3f1, 2017.1.0p2, 2017.2.0b5, 2017.3.0a2
Not reproducible with: 2021.1.0a2
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
- UI Overlay Image gets darker on each Camera when multiple Cameras are used
- Assertion failed on expression: 'scriptedImporterClass == SCRIPTING_NULL error when opening the standalone profiler window
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
Resolution Note:
The side problem of deactivation being expensive relates to all the cubes being at the same spot, and even though they have disabled collision detection by the means of layering - physx would still keep an entry per each overlapping pair because pairwise ignorance is defined not in physx but in unity code. In a real project, I'd suggest making sure the bodies are far away and use ABP broadphase to make sure excess pairs aren't created in the first place.