Skip to content

Systems set to run on state resume do not respect .after() constraints #6130

Description

@Neurrone

Bevy version

0.8.1

What you did

Describe how you arrived at the problem. If you can, consider providing a code snippet or link.

I have my game menus each have a corresponding AppState. For example, there is a state for options menu, main menu etc.

I have two systems:

  • on_previous_menu_event which I need ran before
  • on_resume, which gets ran when I resume a state.

I tried to achieve this by doing the following:

  .add_system(on_previous_menu_event.before(on_menu_spawn))
  .add_system_set(SystemSet::on_resume(AppState::MainMenu).with_system(on_resume.after(on_previous_menu_event)))

The ordering is required for the logic to work correctly.

What went wrong

By inserting print statements into both systems, I see that about half the time, the systems are ran in the opposite order in which I declared above.

Additional information

Other information that can be used to further reproduce or isolate the problem.
This commonly includes:

  • screenshots
  • logs
  • theories about what might be going wrong
  • workarounds that you used
  • links to related bugs, PRs or discussions

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions