Skip to content

It would be nice if Bevy had a commands.entity_option() that returned a Option<EntityCommands<'w, 's, 'a>> #3757

@jm-ra

Description

@jm-ra

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

Sometimes commands.entity(entity_id) panics because the entity is already unspawned.

What solution would you like?

commands.entity_option(...) that returns a Option<EntityCommands<'w, 's, 'a>> ... this would be a workaround for commands.entity(...) that can panic.

What alternative(s) have you considered?

panic::catch_unwind doesn't work.

Additional context

Getting the world with exclusive_system to use get_entity doesn't work in my case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions