Timer & Countdown: How to implement state of the art / best practice?
There are numerous tutorials on the topic of timers and countdowns in UE4 and the UE4 docs also have a section on it. However, there are several different ways to approach an implementation. Thus, I would like to know:
Which way is best in order to achieve accurate timing (including milliseconds) without causing unnecessary overhead?
In case someone reads this post and wonders what different possibilities I could mean (or is just looking for any way to implement a timer or countdown):
asked Jul 27 '17 at 01:17 PM in Blueprint Scripting
Easy to Controll via Handle. Saves you from multiple bool states like isTimerActive, isTimerDone, etc. aswell as not keeping track of a counter. Once its done its gone no more worries here that something is still executing.
Advantages Event Tick:
Best used on things that run indefinitly or to a Unknown amount of Time. If you find yourself adding lots of bools/branches Consider if you actually want to use a Timer instead. Need to keep track of the Counting.
Timelines return you the Value specified at given time passed from the Curve you set (at time X return Value Y). They are not meant to be used as Counter at all. They have also a good Set of Controls and are a Component that comes with a slight overhead.
Advantages Delays (Or better call it Latent Actions)
A Delay is a Latent Action and its basicly a dont proceed execution flow for x Time. The catch is everything before still gets executed when the Function is called again that often leads to undesired behaviour and a classic Bug Source. Delays are a Bad example for a Latent Action but if you think of something like a MoveTo Latent Action it makes sense that you don´t want to execute anything after it until you reach the Target. And thats the advantage of latent Actions: Interupting execution flow until the Action is completed.
Thats a Quick summery of the things you looking at.
Follow this question
Once you sign in you will be able to subscribe for any updates here