-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-Design-DocThis issue or PR is particularly complex, and needs an approved design doc before it can be mergedThis issue or PR is particularly complex, and needs an approved design doc before it can be merged
Description
Bevy version
0.5
Operating system & version
Debian GNU/Linux "buster"
What you did
- Invoke
app.add_state(MyState::StateOne)
- Create a stage
MyStage
- Invoke
app.add_system_set(State::<MyState>::get_driver())
- Add some systems to
MyStage
viaSystemSet::on_update(MyState::StateOne)
, etc. - Add a system that switches between states.
What you expected to happen
Systems that trigger on state enter and exit should run when the state changes, regardless of stage.
What actually happened
Only state change systems in the Update
stage are executed.
I know that the program hasn't completely locked because if I put state change systems into Update
, they work fine. It does lock if I don't add State::<MyState>::get_driver()
, so that's having an effect.
This text in the Bevy Rustdoc made me think this is supposed to work:
If you need to use your state in a different stage, consider using Self::add_state_to_stage or manually adding State::get_driver to additional stages you need it in.
Additional information
Sample code:
test.tar.gz
dimvoly
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-Design-DocThis issue or PR is particularly complex, and needs an approved design doc before it can be mergedThis issue or PR is particularly complex, and needs an approved design doc before it can be merged
Type
Projects
Status
No status