Skip to content

Commit afa65bc

Browse files
Remove base set from OnUpdate system set
1 parent a1e4114 commit afa65bc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

crates/bevy_app/src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,9 @@ impl App {
317317
/// initial state.
318318
///
319319
/// This also adds an [`OnUpdate`] system set for each state variant,
320-
/// which run during [`CoreSet::StateTransitions`] after the transitions are applied.
320+
/// which is configured to run after [`apply_state_transition::<S>`].
321321
/// These systems sets only run if the [`State<S>`] resource matches their label.
322+
/// Like usual, if no base set is configured, these will run in [`CoreSet::Update`].
322323
///
323324
/// If you would like to control how other systems run based on the current state,
324325
/// you can emulate this behavior using the [`state_equals`] [`Condition`](bevy_ecs::schedule::Condition).
@@ -341,7 +342,6 @@ impl App {
341342
for variant in S::variants() {
342343
main_schedule.configure_set(
343344
OnUpdate(variant.clone())
344-
.in_base_set(CoreSet::StateTransitions)
345345
.run_if(state_equals(variant))
346346
.after(apply_state_transition::<S>),
347347
);

crates/bevy_ecs/src/schedule/state.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ pub struct OnEnter<S: States>(pub S);
5353
#[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)]
5454
pub struct OnExit<S: States>(pub S);
5555

56-
/// A [`SystemSet`] that will run within `CoreSet::StateTransitions` when this state is active.
56+
/// A [`SystemSet`] that will run when this state is active.
57+
/// It should always run after [`apply_state_transition::<S>`],
58+
/// and is configured to do so by default.
5759
///
5860
/// This is provided for convenience. A more general [`state_equals`](crate::schedule::common_conditions::state_equals)
5961
/// [condition](super::Condition) also exists for systems that need to run elsewhere.

0 commit comments

Comments
 (0)