-
-
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 run criteria to SystemSet::on_exit overwrites existing one #2609
Comments
Systems are intended to only have one criteria at most, because there is no good universal way to logically join criteria (there's plenty of discussion on that in issues linked from #2446). So, this is not as much of a bug as it is lack of a coherent warning or error; adding criteria to individual systems in a set with criteria does correctly produce an error, at least. I should also note hat it's not possible to pipe into a criteria that isn't set up to be piped into. |
Thanks a lot for the reply! Looking at Until then, perhaps |
That's not really how piping works: the system being piped into needs to be able to take the piped argument and react to it. This is user-specific logic, Bevy can't write that for them automatically. Both criteria and states need reworking before this mess can be untangled for good; we've started the design groundwork for it, but the subset of contributors that are willing and able to champion it are preoccupied. For the short term, my take is the opposite: the |
Duplicate of #1839 |
Bevy version
Checked on 0.5 and main.
Operating system & version
MacOS 11.4
What you did
What you expected to happen
To print
What actually happened
It loops indefinitely, printing:
Additional information
I think the crux of the issue is that when building the
SystemSet
,with_run_criteria
is called:bevy/crates/bevy_ecs/src/schedule/system_set.rs
Lines 68 to 73 in 43d99bb
but then when i add my own
with_run_criteria
, it is overwritten here:bevy/crates/bevy_ecs/src/schedule/system_set.rs
Lines 99 to 102 in 43d99bb
So it's not run on
State
exit, and so it's run before it can detect the entity withFoo
(i think).Maybe a solution could be to pipe the custom run criteria on the one added on
SystemSet
init? That would be my preferred, if possible. Or if that's not possible/intended, perhaps to removewith_run_criteria
from the public API forSystemSet
s?Hope this is useful.
There's a tiny bit more information here
Thanks a lot!
The text was updated successfully, but these errors were encountered: