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
- Sprite Importer Checkbox Label Truncated in UI (2D Template)
- Light theme icon is missing for Volume Component in the Inspector window
- Volume Profile effects are still showing and active in Game View when the Volume Profile is reset
- Shader Graph Tab Lacks Right Margin for Long Titles
- 2DLight component only renders when ShadowCaster2D components are within range in WebGL builds
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a9