-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
It seems an established fact† that observers can not be exclusive systems. This issue is about the opposite.
Running commands.trigger(MyEvent) silently does nothing when done from an exclusive system.
Bevy version and features
bevy 0.17.3
Relevant system information
cargo 1.92.0-nightly (f2932725b 2025-09-24)
OS: debian
$ uname -a
Linux nevermore 6.12.48+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.48-1 (2025-09-20) x86_64 GNU/Linux
What you did
In my project, I had some older code that I was migrating from bevy 0.16, with one part of the code relying on moonshine-save also in need of a larger rework even since before. In that code, I had an exclusive system. The newest version of moonshine-save now uses bevy observers, but adding a commands.trigger call did not do anything. I have now reproduced this with no dependencies other than bevy: Triggering an Event does nothing.
What went wrong
I was expecting commands.trigger(MyEvent) to lead to the execution of the observer that I registered with app.add_observer(my_observer). Nothing happened, the observer was not called. Until I changed my system to no longer take World as parameter.
Additional information
I have attached a small example project that demonstrates the issue.
There are two systems, which cause the sun to rise and set. The observer prints when it observes something. It works fine for the sunrise, but does not observe the sun set.