Panic at parent != previous
When Adding a Child to a Parent When It's Already a Child
#6668
Labels
A-Hierarchy
Parent-child entity hierarchies
C-Bug
An unexpected or incorrect behavior
P-Crash
A sudden unexpected crash
Bevy version
Bevy 0.8.1, and Bevy 9f51651
What you did
What went wrong
IMHO this shouldn't panic.
Additional information
I opened this as a bug because I think something needs to change, even if that is simply the panic message. I got this message occasionally in my game, but it wasn't clear what the actual root cause was without looking deeper into what the Bevy code was trying to do. It turns out it's quite simple: if you try to add something as a child, when it's already a child, it panics here.
If we really think this should panic, then the message should be something like "attempted to add a child to a parent, when it was already a child".
I can see the following reasons to make this panic:
But I think the reasons for not panicking are probably stronger:
The text was updated successfully, but these errors were encountered: