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
- ACES Tonemapping causes banding artifacts and negative values in ColorGradingLUT when HDR is enabled and "High Dynamic Range" Grading mode is selected while Android Platform is used
- Android Player freezes when an Audio Source is playing and an incoming call is picked up and then hung up and the Audio Source is started again
- Green success icon is poorly visible in the light Unity theme
- Incorrect input into the Input Field when using Microsoft IME Japanese
- Multiplayer role "ClientAndServer" is displayed without the spaces in the "Play Mode Scenarios" window
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.