Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup system is not run in "startup_system" Example #735

Closed
MinerSebas opened this issue Oct 26, 2020 · 1 comment · Fixed by #736
Closed

Startup system is not run in "startup_system" Example #735

MinerSebas opened this issue Oct 26, 2020 · 1 comment · Fixed by #736
Labels
C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples

Comments

@MinerSebas
Copy link
Contributor

Bevy version

a7565e9

Operating system & version

Windows 10 64bit

What you did

I was testing the startup_system example, with cargo run --example startup_system

What you expected to happen

The Terminal should print:

startup system ran first
normal system ran second

What actually happened

The Terminal only printed:

normal system ran second

Additional information

The problem is that startup systems are only run, when app.initialize(); is called, and the only places where this is done is in the ScheduleRunnerPlugin and the WinitPlugin.

Code:

fn main() {
    App::build()
        .add_plugin(bevy::app::ScheduleRunnerPlugin::run_once())

        .add_startup_system(startup_system.system())
        .add_system(normal_system.system())
        .run();
}

Output:

startup system ran first
normal system ran second

Code:

fn main() {
    App::build()
        // Neccesary plugins to avoid Panics
        .add_plugin(bevy_input::InputPlugin::default())
        .add_plugin(bevy_window::WindowPlugin::default())

        // Plugin that allows startup_system to be run
        .add_plugin(bevy_winit::WinitPlugin::default())

        .add_startup_system(startup_system.system())
        .add_system(normal_system.system())
        .run();
}

Output:

startup system ran first
normal system ran second
normal system ran second
normal system ran second
normal system ran second
normal system ran second
[...]
@MinerSebas MinerSebas added the C-Bug An unexpected or incorrect behavior label Oct 26, 2020
@MinerSebas
Copy link
Contributor Author

I bisected the commits and found that #690 broke this example

@karroffel karroffel added the C-Examples An addition or correction to our examples label Oct 26, 2020
@cart cart closed this as completed in #736 Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants