Skip to content

Understanding StartupSet #8538

Answered by nicopap
rowanfr asked this question in Q&A
May 4, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

base sets are a bit of a odd one. The concept will be completely revamped in 0.11.

But to answer your question, let's take a look at the implementation of add_startup_system

    pub fn add_startup_system<M>(&mut self, system: impl IntoSystemConfig<M>) -> &mut Self {
        self.add_system(system.in_schedule(CoreSchedule::Startup))
    }

It seems that it uses .in_schedule instead of .in_base_set. So, in bevy 0.10, the startup schedule is completely distinct from the default schedule.

If you use add_system(sys1), you add sys1 to the main schedule, the one that runs every frame. Even if you label it with the .in_base_set(StartupSet::Startup). Therefore sys1 runs every frame.

Why can you add s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rowanfr
Comment options

Answer selected by rowanfr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
A-ECS Entities, components, systems, and events
2 participants