Search Issue Tracker
Fixed in 2021.2.X
Votes
5
Found in
2018.4
2019.2.0a13
2019.4
2020.3
2021.1
2021.2.0a7
Issue ID
1158741
Regression
No
OnTransformParentChanged is called twice when deleting the gameobject in the hierarchy while in play mode
How to reproduce:
1. Open the attached project ("OnTransformParentChanged.zip")
2. Open the repro scene ("SampleScene")
3. Enter the play mode
4. Delete the children object from the Hierarchy
5. Inspect the console
Expected results: OnTransformParentChanged is called once
Actual results: OnTransformParentChanged is called twice
Reproducible with: 2018.4.33f1, 2019.4.24f1, 2020.3.3f1, 2021.1.2f1, 2021.2.0a7
Not reproducible with: 2021.2.0a9, 2021.2.0a11
Could not test with: 2021.2.0a8 (Backend Errors)
Notes:
1. During the first "OnTransformParentChanged" call, the parent is set to null, and during the second call it is set to the old parent value again
2. Destroying the object with "Destroy" method does not result in any "OnTransformParentChanged" calls
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
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
- Incorrect warning icon and wrong message displayed in HDRP Decal Projector
- [Dragon Crashers] Build fails in U6
- [Dragon Crashers] 4 Shader error messages on import
- [Dragon Crashers] Readme text is white on light grey
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a9