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.
- All models become suddenly stuck in weird poses and Animations are messed up when previewing any character animation in the Editor and looking around in the Scene View
- Files are not included in the “Assembly-CSharp.csproj” file when they are in the Editor folder
- [URP] Specular Color behavior does not match Legacy or HDRP
- [Linux] Array Element doesn't duplicate/delete when clicking "Duplicate/Delete Array Element" on an Array Element in a Prefab GameObject
- [ShaderGraph] Skewed guidelines are drawn from the top left corner of the Node when it is moved