#App State is not working

4 messages · Page 1 of 1 (latest)

eternal mural
#

so, in my version of that I haven't broken things into plugins as comprehensively, but I have

#[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Hash, States)]
pub enum GameState {
    #[default]
    Loading,
    Playing,
}

for my states, and

.add_state::<GameState>()

in my app setup

#

then when I need to change, I have systems like

pub fn some_loading(mut next_state: ResMut<NextState<GameState>>) 
{
   ...
    next_state.set(GameState::Playing);
}
granite junco
#

I'm running into this error now :/

Resource requested by bevy_game::game::systems::toggle_simulation does not exist: bevy_ecs::schedule::state::State<bevy_game::game::SimulationState>
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 3
sh: line 1: 27128 Abort trap: 6           cargo run
[Finished running. Exit status: 134]
#

this is after it runs the
next_state.set(AppState::Playing); method