Search Issue Tracker
Won't Fix
Won't Fix in 2023.2.X
Votes
0
Found in
2021.3.25f1
2022.2.18f1
2023.1.0b16
2023.2.0a14
Issue ID
UUM-35112
Regression
No
[Undo] DestroyGameObjectHierarchyEventArgs.parentInstanceId is 0 when using undo on a created Child GameObject
Steps to reproduce:
1. Open the attached user's project "example_video.mov"
2. Open Assets/Scenes/SampleScene.unity
3. Right-click the "ParentObject" gameobject and select "Create Empty" to create a child gameobject
4. Press the "Enter" key to accept the child gameobject name
5. Right click the child gameobject and select "Delete"
6. Note the log message in the console: "DestroyGameObjectHierarchy: XXX with parent ParentObject in scene SampleScene."
7. Right-click the "ParentObject" gameobject again and select "Create Empty" to create a child gameobject
8. Press the "Enter" key to accept the child gameobject name
9. Go to the top menu and select "Edit/Undo Create GameObject"
10. Note the log message in the console: "DestroyGameObjectHierarchy: XXX with parent { null } in scene SampleScene."
11. The null parent gameobject in the second scenario seems to be caused by DestroyGameObjectHierarchyEventArgs.parentInstanceId being 0 in the callback
Expected results: DestroyGameObjectHierarchyEventArgs.parentInstanceId is not 0 when using undo on a created child gameobject
Actual Results: DestroyGameObjectHierarchyEventArgs.parentInstanceId is 0 when using undo on a created child gameobject
Reproducible in: 2021.3.25f1, 2022.2.18f1, 2023.1.0b16, 2023.2.0a14
Could not test on 2020.3.48f1 due to scripting errors when downgrading
Notes:
-A video is attached to show the reproduction steps "example_video.mov"
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
- Scaled Backgrounds List and dropdown text are enabled while Scaled Backgrounds field is disabled in IMGUI Debugger window
- Editor crashes when large value is entered in Scaled Backgrounds field of IMGUI Debugger window
- "Custom Function" Node "Input" type changes do not immediately show mistmatch errors when set to an incompatible type in Shader Graph
- My Assets list is populated with Asset Packages when setting how many Packages to display before clicking the Load button
- Hub shows 6.0 as Latest LTS when opening a project after deleting its 6.3 Editor version
Resolution Note:
We have looked at this and we agree that the behavior is counter-intuitive. However, there is no expectation that UI interactions correspond one-to-one to events in the event stream. In the short term we are not going to address this issue, unfortunately.
A closer look at the events in the stream shows that we do record a parent change event before the event for object destruction. This preceding event can be used to determine the parent of the destroyed object.
Resolution Note (2023.2.X):
We have looked at this and we agree that the behavior is counter-intuitive. However, there is no expectation that UI interactions correspond one-to-one to events in the event stream. In the short term we are not going to address this issue, unfortunately.
A closer look at the events in the stream shows that we do record a parent change event before the event for object destruction. This preceding event can be used to determine the parent of the destroyed object.