Delay node interrupts Event

Hey, I have this little Script

when the event “DecreaseSpeedOverTime” is executet it prints:

Speed -25

(waits 0.75 sec)

Speed +25

all fine and good. The Problem is when this events gets executet two times in between 0.75 sec. Then it prints:

Speed - 25

Speed - 25

Speed + 25

the second Speed +25 is missing…

My Goal is that i decrease the speed of an Enemy every time i shoot it for some time, and the decreasement is stackable. Does Anyone has a solution for this problem?

The example given simply uses a ‘Counter’ variable to check how many times In vs Out the full script has been fired and hold the remaining within the variable. *Then check if the variable is more than or equal to 1 (1 held execution), if so trigger the delay again. Storing the Counter in a variable will be useful if you want to make the number of held +25% executions affect the speed in which they are regained. Such as 10 held executions could divide the 0.75 delay to give a 10% faster recovery.

On delays:
The basic delay will ignore any further executions until the delay has finished.
The retriggerable delay will reset the delay timer with each execution.

KerberusGames solution works, but it will not keep the timing at which the events occured. So if you press F, then F again after 0.1 seconds, the second event will be off after 1.5 seconds and not 0.85 seconds.

So here’s a version that will keep the timing right.

The “ListOfDates” variable is of type DateTime and set as a list.

Hope this fits your need

Cheers,

  • Marc

yea thanks, i thought about something similar… but hoped it could be more simple. Thanks to you both! Will try this tomorrow but im sure this will do the job.