Hi there,
I’m new to UE4.26 and having two problems to trigger one function periodically in a certain period of time.
First question: How to call the function once at start before it runs periodically and control the total looping time?
For example, I have a function called OnFireDamage. When I triggered it for the first time, I want to set a timer for this to trigger it periodically for a certain time. For example, I throw a fire ball to the enemy and set him on fire, so he would take fire damage every 1 sec for totally 5 seconds. As I want him to take damage at the very beginning, for 5 seconds totally, he should take the fire damage for 6 times.
When I’m using the set timer by function name node in blueprint, I didn’t find a way to make sure the function is called once when the timer starts. And I also can’t find a way to control the total looping time.
Second question: How to have different timer handle for the same function?
For the same scenario, I have the OnFireDamage function. If I fire the enemy with fire ball for the first time, it fires the enemy every 1 sec. And after 0.7 secs, if I fire the enemy with fire ball again, it would reset the previous timer handle and restart to fire the enemy every 1 sec.
As the Set Timer By Function Name node tooltips says that “Set a timer to execute delegate. Setting an existing timer will reset that timer with updated parameter”.
But I want them to run periodically both. For example, the very begining of the first fire damage starts from 0 in timestamp, and run periodically every 1 sec. And the second fire damage starts from 0.7 secs in timestamp and run periodically every 1 sec as well. But the Set Timer By Function Name node automatically resets the timer which I don’t want to. How can I avoid this?