Result::unwrap()
on an Err
value: StateAlreadyQueued' #5552
Closed
Description
Bevy version
0.8
Relevant system information
OS: Windows 11
What you did
I attempted to set change my gamestate like so:
// Change the state
if *state.current() != event.0 {
state.set(event.0).unwrap();
}
What went wrong
Doing so crashes the game with the following error:
Result::unwrap()` on an `Err` value: StateAlreadyQueued'
Additional information
The current workaround i took was to use State::overwrite_set
instead like so:
// Change the state
if *state.current() != event.0 {
// Using [`State::overwrite_set`] instead of [`State::set`] to cirvumvent the 'Aleady Scheduled' bug.
state.overwrite_set(event.0).unwrap();
}
Edit: To clarify, this system is only being called once per frame and the state isn't currently being changed anywhere else in the code.
Metadata
Assignees
Type
Projects
Status
No status
Activity