Skip to content

Unexpected SystemInMultipleBaseSets panic due to on_update #7632

@NiklasEi

Description

@NiklasEi

Bevy version

main branch a1e4114

What you did

I am trying to order an exclusive system in a pretty standard way for Plugins using states:

  1. The system should run early in every frame (before any "normal" user systems)
  2. The system should only run in the given state
            .add_system(
                exclusive_system
                    .in_base_set(CoreSet::PreUpdate)
                    .in_set(MySet::Label)
                    .on_update(MyStates::State)

What went wrong

This triggers the unexpected panic SystemInMultipleBaseSets { system: "Some(System exclusive_system: {is_exclusive})", first_set: "StateTransitions", second_set: "PreUpdate" }'

Additional information

  • The fact that this is an exclusive system seems irrelevant; the same panic happens with a normal system
  • replacing on_update with run_if(state_equals(MyStates::State)) removes the panic, but is the exact behaviour I would have expected from on_update

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions