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"