-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Hard lock using State across stages #1671
Comments
Able to reproduce on macos. It seems that the |
this freeze for me: use bevy::prelude::*;
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_state(GameState::Freeze)
.add_system_set_to_stage(
CoreStage::PreUpdate,
SystemSet::on_update(GameState::Freeze).with_system(do_something.system()),
)
.run();
}
#[derive(Clone, Eq, PartialEq)]
pub enum GameState {
Freeze,
}
fn do_something() {} it does not freeze if the system set is added to stage |
this is because the system set bevy/crates/bevy_app/src/app_builder.rs Lines 180 to 183 in 284889c
bevy/crates/bevy_app/src/app_builder.rs Lines 139 to 141 in 284889c
|
Indeed, this patch to the code from the original issue seems to make things work properly .add_state(GameState::Start)
+ .add_state_to_stage(CoreStage::PreUpdate, GameState::Start) |
Removing this from the 0.5 milestone in favor of #1746 |
This is intended to help protect users against #1671. It doesn't resolve the issue, but I think its a good stop-gap solution for 0.5. A "full" fix would be very involved (and maybe not worth the added complexity).
Can confirm both bug and workaround from @rparrett (thanks!). |
Checking in, is this still relevant after stageless? States now work across base sets and the run conditions have significantly simplified the mental model for states. |
This is no longer possible. |
Bevy version
main: 284889c
Operating system & version
Windows 10 20H2
What you did
What you expected to happen
When the return key is pressed the state transitions to
GameState::Freeze
and thedo_something
system begins firing.What actually happened
When the return key is pressed the application hard locks and enters "not responding".
Additional information
If I try to use a state that I added with
add_state(..)
as a run criteria for a system I add to any stage other than update (viaadd_system_set_to_stage(..)
, the application freezes as soon as the state transition occurs.The text was updated successfully, but these errors were encountered: