It doesn’t matter how fast the hardware event fires, as this just triggers a hardware interrupt, which places and even into the operating system event queue.
Events are then processed by UE4 from this queue each frame using a loop along the lines of:
While there are events in the queue:
- Pop Next Event off Queue
- Process Event
It’s the last bit, “Process Event,” which actually calls the blueprint event node; this action waits for that event node to return, i.e. the end of the execute thread (or a delay node, which is actually just setting a timer to fire another event as a separate thread, but displayed as a single thread).
This means that the first event has already finished and locked the Do Once node before the second event is processed.
Note UE4 may be buffering the OS events into its own even queue I haven’t checked the implementation details, also timer events may be included in this loop or use a separate loop however this is irrelevant to the argument.
As for debugging, I suggest, adding an index you increment for each event and one for each tick (i.e. frame), finally, a variable for last fired time, then printing “Attack {ActionIndex} in Frame {FrameIndex} Delta {Time since Last Fired}
” or similar, after the delay node “Resetting Attack {ActionIndex} in Frame {FrameIndex} Delta {Time since Last Fired}
”, (note don’t reget the variables you must execute them before the delay node, but printed after, so they match except the Delta which should use the current time. With this setup, the “Resetting Attack” should always appear between Attacks.
As to your hardware problem, I suspect you have misinterpreted whats actually happing; rather than getting multiple pressed events when you press the button, I suspect the debouncing circuit is faulty and when you release the button, the button is bouncing, so you sometimes get [Pressed, Button Held Down, Released, Pressed, Released]
, now if the length of Button Held Down exceeds your delay, or in your timer example the time fires during this period, you get to Attack, given the short time, you wouldn’t really be able to perceive these as separate events. To Check this I would suggest setting up a matching node group for the released event. Then, when the double firing occurs you should get [Attack Pressed, Attack Pressed Reset, Attack Released, Attack Pressed, Attack Released Reset, Attack Pressed Released]
if this is the case.