Skip to content

Chained observers don't work when with OnRemove when entity is despawned #19889

@Freyja-moth

Description

@Freyja-moth

Bevy version

0.16.1

What you did

fn on_remove(on_remove: Trigger<OnRemove, Thingy>, mut commands: Commands) {
    commands.entity(on_remove.target()).trigger(OtherObserver);
}

What went wrong

I was expecting the second observer to be run, but it panics with

The entity with ID <id> was despawned by /home/.../.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_ecs-0.16.1/src/spawn.rs:62:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    Status

    Observer overhaul

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions