-
-
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
AssetServer.watch_for_changes()
must be called before creating window
#3627
Comments
Example Were you able to reproduce on windows? |
The |
Works on linux for me as well (tested v0.6.0 tag and main) |
I can confirm multiple issues with shader hotreload:
asset_server.watch_for_changes().unwrap();
App::new()
.add_plugins(DefaultPlugins)
.insert_resource(AssetServerSettings { // does NOT work
watch_for_changes: true,
..default()
})
// other stuff
.add_startup_system(setup)
.add_system(some_system)
.run(); Thankfully due to insight from this issue I figured I should put this at the top of my program, something like: App::new()
.insert_resource(AssetServerSettings { // Works
watch_for_changes: true,
..default()
})
.add_plugins(DefaultPlugins)
// other stuff
.add_startup_system(setup)
.add_system(some_system)
.run(); |
Someone on the discord also noted using asset_server.watch_for_changes().unwrap() anywhere in the app will break this workaround. |
Fixed by removing the |
For some reason, calling
watch_for_changes
in asetup
function will not register file events in the future, while doing it before starting the app will.The exact point at which it breaks is
winit::WindowBuilder::build
, call watch_for_changes before and it will work, call it after and it won't.Tested on linux with x11 and wayland, will try windows later.
The text was updated successfully, but these errors were encountered: