bevy
bevy copied to clipboard
Avoid unconditionally unwrapping the Result - UI Stack System
Objective
- Fixes #11572
Solution
- Avoid unconditionally unwrapping the
Resultin theui_stack_systemfunction.
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.
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.