Search Issue Tracker
Fixed in 2021.2.X
Fixed in 2020.3.X, 2021.1.X
Duplicate in 2021.1.X
OnEnable/OnDisable is called the second time when setting GameObject's instance flags to HideAndDontSave
How to reproduce:
1. Open the attached project's Scene labeled "MyScene"
2. In the Hierarchy, select the "GameObject"
3. In the Inspector, Right-Click the "Hide And Dont Save Object" Component
4. From the context menu, select the "CreateInstanceWithHideFlags" option
5. Observe the Console Window
Expected result: OnEnable/OnDisable functions are called once
Actual result: OnEnable/OnDisable functions are called multiple times
Note: The extra deactivation and activation comes from UnityScene::HandleChangingPhysicsScenes
Reproducible with: 2017.4.40f1, 2018.4.22f1, 2019.3.11f1, 2020.1.0b6, 2020.2.0a8
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Photoshop .psb textures are importing all-grayscale [2022.1 regression]
- [Search Picker] Undoing selection in unity while the picker is opens doesn't close the picker
- [Android] APP becomes unresponsive and crashes with ANR errors
- Replace no longer replaces when using incremental pipeline
- [LightProbes] Individual light probe gizmos are no longer visible