Skip to content

Trigger::components() does not return the expected results #17634

Open
@cBournhonesque

Description

@cBournhonesque

How can Bevy's documentation be improved?

The docs here mention that the trigger components will be

the components that triggered the observer, out of the
    /// components defined in `B`

That is not the observed behaviour

world.spawn(
    Observer::new(|trigger: Trigger<OnAdd, A>| {
        dbg!(trigger.components());
    })
);
let mut entity = world.spawn((A, B));

When the observer runs, the trigger.components() will contain the component ids for A and B.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    Status

    Observer overhaul

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions