-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
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.
meanbeanmachinedimvoly
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Type
Projects
Status
No status