-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Adding ScheduleRunnerPlugin after default plugin crashes at startup #221
Comments
After some more experimentation, it seems that When adding bevy/crates/bevy_winit/src/lib.rs Lines 27 to 32 in 4a06bbf
So when using |
Yeah ScheduleRunnerPlugin is an alternative to winit. I think the fix here is to add some sort of "frame limiting" config, which will handled by #125. I think we should just scope this issue to resolving the "fixed interval" issue with ScheduleRunnerPlugin. |
Closed by #233 (im happy to re-open this if you think I missed something) |
I encountered this issue when running headless. The root cause is that when not using
Following simple program is enough to reproduce the issue: use bevy::{app::ScheduleRunnerPlugin, prelude::*};
use std::time::Duration;
fn main() {
App::build()
.add_plugin(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(
1.0 / 60.0,
)))
.add_system(counter.system())
.run();
}
fn counter(mut state: Local<CounterState>) {
println!("{}", state.count);
state.count += 1;
}
#[derive(Default)]
struct CounterState {
count: u32,
} $ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Running `target/debug/local_test`
thread 'main' panicked at 'Resource does not exist local_test::CounterState', /home/smoku/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/macros.rs:16:9 |
Thanks for your work!
I've been experimenting a bit and stumbled across the
ScheduleRunnerPlugin
. However, when the plugin is added after the default plugins, it crashes on startup. When adding the default plugins after theScheduleRunnerPlugin
, it works fine.Minimal example:
Fails with:
Short Backtrace
Full backtrace
bevy version:
0.1.2
and 99e39b5rustup toolchain:
nightly-x86_64-pc-windows-msvc
rust version:
rustc 1.47.0-nightly (7e6d6e5f5 2020-08-16)
Kind regards,
Lukas
Sidenote: as far as I can tell,
ScheduleRunnerPlugin
waits a fixed amount of time between each update but does not schedule updates in a fixed interval (1/60 is not necessarily 60 fps). I assume this is either intended or being planed (maybe with #125) but for the moment,bevy/examples/app/headless.rs
Line 18 in 99e39b5
The text was updated successfully, but these errors were encountered: