How to stop a delay?

Just in case someone stumbles upon this, you can solve it with a macro that simulates the set timer node + timer handler behavior.

Basically you can use a delay “handler” property (a GUID). The macro creates an ID and updates the handler before calling the actual delay. Once the actual delay completed, the macro checks if the ID of the handler is still the same, and fires the “Completed” pin of the macro. The key thing here is to pass the ID as reference in the inputs of the macro.

You can think of it as a delay node + a boolean branch as next node, with a bool property that you set somewhere to prevent the execution of the next nodes.

Side note, technically, the actual delay node won’t stop, but the macro hides this behavior.

This is the macro (I created it in the level blueprint but you should use a macro library),

and this is the usage

1 Like