bevy_eventlistener icon indicating copy to clipboard operation
bevy_eventlistener copied to clipboard

Support targeting multiple entities

Open musjj opened this issue 1 year ago • 1 comments

Some events intrinsically needs to targets multiple entities.

For example collision events will need to be able to report to multiple entities. You can currently simulate this by cloning the event (which can contain lots of data like a vector of manifolds) and sending them to each entity.

I think the ability to natively target multiple entities would help a lot for this kind of use-case.

musjj avatar Apr 17 '24 13:04 musjj

You would need to clone the event regardless. Events need to traverse the hierarchy and can be mutated. If you target two entities, you need two events. If your event is not mutated and you want to avoid cloning it, you can Arc the data.

aevyrie avatar May 04 '24 05:05 aevyrie