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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
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.