Reproduction Steps:
- Run the scene
- Press the Z key to open the menu and wait for object generation to complete (this process is somewhat laggy)
- Press the Z key again to close the menu, then reopen the menu (sometimes crashes on the first reopen, sometimes on the second)
Problem Description:
- The process of generating objects after opening the menu is normal (though slightly laggy)
- The process of closing the menu also executes normally (tested both with and without deleting objects upon closing)
- However, when reopening the menu, crashes may occur:
- Sometimes it crashes immediately
- Sometimes it crashes during object generation
Suspected Cause:
When closing the menu, the ObjectMountTarget node disappears first, causing subsequent child objects to lose their hierarchy path, resulting in a crash.
(In the main project, I modified the logic so that when closing the menu, I first change a variable to make child objects disappear before closing the menu — this prevents crashes.)
Additional Note:
If you enable the “Change Variable” action within the “Disappear/Delete” action of the object [bug]’s VS (state machine), the crash no longer occurs.
(In other words, if child objects are deleted when the menu closes, they regenerate correctly when the menu is reopened.)
