Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs around observer Trigger::components() is not clear #17634

Open
cBournhonesque opened this issue Feb 1, 2025 · 0 comments
Open

Docs around observer Trigger::components() is not clear #17634

cBournhonesque opened this issue Feb 1, 2025 · 0 comments
Labels
A-ECS Entities, components, systems, and events C-Docs An addition or correction to our documentation D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@cBournhonesque
Copy link
Contributor

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.

@cBournhonesque cBournhonesque added A-ECS Entities, components, systems, and events C-Docs An addition or correction to our documentation D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Triage This issue needs to be labelled and removed S-Needs-Triage This issue needs to be labelled labels Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Docs An addition or correction to our documentation D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

No branches or pull requests

1 participant