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.
- 1 frame long audio clip plays an inconsistent audio sample or does not play at all in the Timeline
- ApplyModifiedProperties is not returning true when editing a List field with custom editor code
- Labels Overlap in NavMeshObstacle Inspector when shape is set to "Box" and Inspector's width is small
- [Enlighten] Server build starts Enlighten worker threads
- Semi transparent particles are incorrect in the game view