Skip to content
Discussion options

You must be logged in to vote

If you add the ReportExecutionOrderAmbiguities resource to your world, you'll see that watch_menu_clicks and watch_game_clicks are ambiguous in both cases. By coincidence of how the executor's ordering runs, it happens that when it's not using the state handling, watch_game_clicks runs first in a frame; when you are using the state version, watch_menu_clicks happens first.

Hence, when using states, the watch_game_clicks runs in the same frame as you switch to being in game, so the button was just_pressed in that frame. When not using states, watch_game_clicks runs the frame after, whilst the button was still being pressed, but it's 'just_pressed'-ness had been cleared.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@pubrrr
Comment options

@DJMcNab
Comment options

DJMcNab Jan 17, 2022
Collaborator

@hymm
Comment options

hymm Jan 17, 2022
Collaborator

@pubrrr
Comment options

Answer selected by pubrrr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants