Skip to content
Discussion options

You must be logged in to vote

When you despawn the entities with the P component you don't fixup the Parent component of their children, which remains there pointing now invalid entities. Then bevy_inspector_egui shows only entities without a Parent component, which filters out your entities with a C component.

Consider calling .clear_children() before .despawn():

        for p_entity in &query {
-            commands.entity(p_entity).despawn();
+            commands.entity(p_entity).clear_children().despawn();
        }

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@alexniver
Comment options

Answer selected by alexniver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants