Safely cancel a delay?

How can I cancel a delay safely? In UE3 in Kismet it was possible to cancel delay but in UE4 blueprint there seems to be no way at all to do it. I mean I could make a gate or a branch behind the delay but then I still need to wait somehow for the delay to be run out to have it canceled which is obviously not really a cancel and not safe.

Well, I would like to keep using delays, creating a timer for everything seems to be over complicating things. I basically have lots of tasks in my blueprint which can’t be just all done in 1 tick for performance reasons. With delays the whole things needs to be restart able without creating a mess because things can change while delays are running. There are multiple delays used so using retrigger able delay will not help much.

you cant cancel a delay. if you want to be able to cancel something similar to a delay, you can use a timer or a timeline, or you can put a boolean branch or a gate after the delay, which stops the execution path from continuing, but it won’t stop the delay from executing.

with clever organization, you may be able to solve many of your delay problems reusing the same timer. if you have a long series of tasks that have to be performed in order, but they are too expensive to do during a single frame, you can have an integer that keeps track of which step of the problem you are on, and the timer event can switch on that integer to decide what to do next. that way, you can cancel the timer using its handle, and you can solve a long list of calculations using 1 timer.

1 Like