bevyengine / bevyengine/bevy

Add the ability to cancel delayed commands

Open
#24,175 5 comments 0 reactions 0 assignees View on GitHub
A-ECS A-Time C-Feature D-Complex S-Needs-Design X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

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

When using delayed commands for things like animations, sound effects or gameplay effects,
you'll often want to *stop* the command from taking effect if the originating entity dies.

## What solution would you like?

Expose the entity reference of the delayed command tracking entity somehow during delayed command creation.

## What alternative(s) have you considered?

Current workaround: query DelayedCommandQueue, despawn what you want cancelled.

Alternatively, embed the orginating entity in the delayed command, and check during application that the entity still exists.

## Additional context

Noticed when writing the release notes for Bevy 0.19 :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.