-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Result::unwrap()
on an Err
value: StateAlreadyQueued'
#5552
Comments
This error means that you already changed the state in this frame. The Without more context, this seems to work exactly as expected 👍 |
@mockersf I'm getting this panic after updating to version 0.8, without any code changes related to states or system sets. When I print the current app state at the
Let's call the states A, B, and C by their logical order. I'm trying to transition to state C, and as you can see from above, C can't be found from the current state as scheduled or as the current state. Edit: The state change is scheduled from a system that runs at |
The error is saying there is already a transition ongoing, which you can see by It doesn't have the best name, it's |
Ah, I see. Thanks for the clarification! Still, how can the |
I think it's a bug that it was accepted before. #4890 is probably the source of your panic. setting a new state in |
Yeah! That must be it. I'll see if there's a better way to handle the three states, maybe by making state B redundant. |
I am having a similar problem. Code was fine in 0.7 but now in 0.8 I get the same error. You can see here the system that handles changing the states (turns in my case). It is only 45 lines: https://github.com/thephet/BevyRoguelike/blob/main/src/systems/end_turn.rs |
I am not changing the state anywhere else in the code and the system is only called once per frame. The code worked fine in 0.7 but broke after 0.8. |
I'm seeing this error when trying to change the state again in a system running |
@NeoRaider by @mockersf 's description, it seems that changing a state in In general terms, should the transition be finished before a FSM state is entered? In FSM's I've authored, the transition belongs to the "previous" state (the one where the transition begins), and the next state should not need to be aware of the transition (it has a separate set of transitions). Pseudocode:
|
Using https://github.com/bevyengine/bevy/blob/latest/examples/ecs/state.rs as the inspiration, I find this behavior confusing. This is enough to reproduce the StateAlreadyQueued
Using btw I am on bevy 0.9.1 on Linux |
This error and the entire state stack was removed in #7267. |
Seems related to bevyengine/bevy#5552
Bevy version
0.8
Relevant system information
OS: Windows 11
What you did
I attempted to set change my gamestate like so:
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: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.
The text was updated successfully, but these errors were encountered: