Skip to content

Add a despawn_children method #19556

Closed
Closed
@Freyja-moth

Description

@Freyja-moth

What problem does this solve or what need does it fill?

Currently there are methods that add a child/children to an entity without having to specify the relationship, but the same isn't true for despawning.

What solution would you like?

Add a despawn_children method to EntityCommands

pub fn despawn_children(&mut self) -> &mut Self {
    self.despawn_related::<Children>();
}

Obviously this isn't really all that important, but it's nice to have the symmetry.

What alternative(s) have you considered?

commands
    .entity(entity)
    .despawn_related::<Children>();

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or changeC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with BevyS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions