Bad Usage of Commands and Events #11732
-
I'm wanting to trigger |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
While events can linger over a frame this is only to ensure every system will process those events. Every event will only be seen once by each system, it just may be a frame late if the system already ran before the event was sent. I have encountered similar issues with those events crossing frame boundaries under certain circumstances. Typically, in places where the entity may be destroyed before the the event is processed. You may need to implement checking to see if the entity exists before attempting to handle the event. Since you are doing events associated with an |
Beta Was this translation helpful? Give feedback.
While events can linger over a frame this is only to ensure every system will process those events. Every event will only be seen once by each system, it just may be a frame late if the system already ran before the event was sent. I have encountered similar issues with those events crossing frame boundaries under certain circumstances. Typically, in places where the entity may be destroyed before the the event is processed. You may need to implement checking to see if the entity exists before attempting to handle the event.
Since you are doing events associated with an
Entity
, it may be helpful to use the 3rd party librarybevy_eventlistener
. Based on my understanding, the library is bui…