Open
Description
What problem does this solve or what need does it fill?
Panics when working with commands are extremely frustrating, and difficult to debug or guard against.
What solution would you like?
We can reduce the pain in the common case by making commands.entity(my_entity).despawn()
fail silently if the entity does not exist.
There is no real risk to doing so, as the desired state is completed. This is also useful as it makes despawn commands idempotent, making them significantly more robust and easier to work with.
What alternative(s) have you considered?
#2004 represents a more complete solution, but is dramatically more complex. This is also a better default for this particular command.
Additional context
We may also want to change the behavior of other commands, but that should be done in separate PRs to avoid blocking this less controversial change.
Metadata
Metadata
Assignees
Labels
Entities, components, systems, and eventsA targeted quality-of-life change that makes Bevy easier to useA breaking change to Bevy's public API that needs to be noted in a migration guideThis issue requires design work to think about how it would best be accomplishedThere is active debate or serious implications around merging this PR