Trigger::components() does not return the expected results
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## How can Bevy's documentation be improved?
The docs [here](https://github.com/bevyengine/bevy/blob/9bc0ae33c37728fc5215c833e3f4e78dc2abb7b9/crates/bevy_ecs/src/observer/mod.rs#L90) 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| {
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.
Contributor guide
Research direction
Read the observer documentation in crates/bevy_ecs/src/observer/mod.rs around the linked section, then run the provided Observer::new and world.spawn((A, B)) reproducer. Compare the documented Trigger::components() behavior with the observed component IDs and update the documentation so it accurately describes the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, game-dev
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100