Ensuring the execution of an event when it is executed multiple times?

Hi everyone,

I’ve been playing around with the following Blueprint:

To summarise, whenever an actor is hit by a line trace (raycast), a MID is created, a MID parameter is changed, and then after a delay, the MID parameter is reset. Everything works as intended. However, if the event is executed (again) before the delay duration (2 seconds), the MID parameter doesn’t get reset. Ultimately, I’d want the event to be queued so that all of the MID parameters get reset, regardless of how many times the event is executed. I’ve tried converting the “HitComponentColour” variable to an array, and although the array gets added to successfully, I was still unable to make it function correctly.

Any help will be greatly appreciated. Thanks!

Right now, the delay nodes are the only sure way I know of making that happen. However, it might be possible for you to build a queue in your BP. Create an array on the actor, as the hits come in, add the relevant info into the array. In your MID processing BP here, put a bool called processing. When the process fires, set the bool to true, when it completes, set it to false. Toss an IF branch in at the beginning so that it only fires if processing is false. At the end of your code, remove the index from the array that you are processing and pull the next one. etc.