problem with timer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Abdulelah444


I have a function that is run in _process() and I wanna time it so that after couple of seconds it stops running…
I made it so that if a certain bool is true the function runs, now I want the timer to be triggered when that bool is true also and want it to turn it false after couple of seconds, the problem is that my timer never time-out it get triggered every frame and I don’t know how to deal with this

:bust_in_silhouette: Reply From: Maxpilot

Sounds like you have to trigger the timer not when the certain bool ist true, but only when it’s going from false to true. So you have to remember the old state in a variable.