I have a BeginonEventPlay which calls a looping event “DOF magic” with a timer.
But I want to configure this in such a way that a Keypress will trigger it and KeyRelease will stop it. ( It’s a Post Process Effect )
I tried using a branch node but I am not sure how to stop the event or the timer.
The SetTimer node returns a TimerHandle. You can use your handle to communicate with that given Timer. Your other option is the ClearTimerByFunctionName node.
You just call SetTimer on the key Pressed event, and call ClearTimer on the Released event.
Hi Kontur
Thanks a lot,
This method worked, but partially.
The timer stopped. But the my DOF_Magic was still executing after my key release.
I had my debug marker running when I hit the key press and it stopped when I released the key. But the DOF magic will still running. How can I stop this function entirely and restart the timer loop on key press?
Hi Kontur
I have used this method to override my Focus Distance on Key release. So it’s working as I want it now.
But I would like to know how to stop a function from executing entirely as well.
A lot of helpful people on here🤦 if you need the timer to start without a delay just put a very small value into the time box in the timer, like 0.01. This will fire it off pretty much immediately.
You can also call that function manually, just after the trigger but before the timer, so, the first time, the function will be called (once) inmediately, followed by a timer which will call it again under a frequence.