You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ItsDoot opened this issue
Sep 20, 2024
· 2 comments
Labels
A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorD-ComplexQuite challenging from either a design or technical perspective. Ask for help!
What problem does this solve or what need does it fill?
The fact that the B in Trigger<E, B: Bundle> currently means OR instead of AND is confusing enough that it even surprised a maintainer. Everywhere else in bevy, tuples (which bundles can be) mean AND, so we should change Trigger's default behavior.
What solution would you like?
The following code should work (but doesn't currently):
fnmy_observer(trigger:Trigger<Foo,(A,B)>){}// This *should not* trigger the above observer:
world.trigger(Foo, world.component::<A>());// But *this* should:
world.trigger(Foo,(world.component::<A>(), world.component::<B>());
Note that the implementation here is difficult as the observer lookup structure does not support this in any way so care will have to be taken not to regress performance when addressing this. I wouldn't consider it straightforward.
ItsDoot
added
D-Complex
Quite challenging from either a design or technical perspective. Ask for help!
and removed
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
labels
Sep 20, 2024
ItsDoot
changed the title
Replace Trigger's bundle filtering behavior from an OR to an AND.
Replace Trigger's default bundle filtering behavior from an OR to an AND
Sep 20, 2024
A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorD-ComplexQuite challenging from either a design or technical perspective. Ask for help!
What problem does this solve or what need does it fill?
The fact that the
B
inTrigger<E, B: Bundle>
currently meansOR
instead ofAND
is confusing enough that it even surprised a maintainer. Everywhere else in bevy, tuples (which bundles can be) meanAND
, so we should changeTrigger
's default behavior.What solution would you like?
The following code should work (but doesn't currently):
Additional context
Moment of confusion on discord.
The text was updated successfully, but these errors were encountered: