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
- Unapplied changes on the "MainPanel" GameObject in the "BlobShadow" of URP Samples
- [Vulkan][Android] The Player crashes on devices with SP9863A chipset
- "Output properties of this Camera do not match the output properties" warning is shown In the "SplitScreen" scene of URP Samples
- "Gun" Prefab used in "MixedFOV" scene of URP Samples has unapplied changes
- "FirstPersonController uses the legacy input system" message is logged when entering the Play Mode in "MixedFOV" scene of URP Samples
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a9