bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Avoid unconditionally unwrapping the Result - UI Stack System

Open garychia opened this issue 1 year ago • 2 comments

Objective

  • Fixes #11572

Solution

  • Avoid unconditionally unwrapping the Result in the ui_stack_system function.

garychia avatar Jan 28 '24 06:01 garychia

Ah thank you for fixing this. So On deeper digging I found that this error is caused because despawning a child does not automatically remove the child from its Parent, and so UI stack gets re-populated with removed entity because parent still thinks they have a child. I think I better fix would be to remove children from parents on despawn.

Hexorg avatar Jan 28 '24 11:01 Hexorg

I think I better fix would be to remove children from parents on despawn.

IMO we should do both. I'm happy with this PR as a first step, and then that as a more complex and controversial follow-up fix.

alice-i-cecile avatar Jan 28 '24 20:01 alice-i-cecile