[Solved] Understanding timers

This is an in-depth question about timers and I read http://wiki.compilgames.net/doku.php/gdevelop5/all-features/timers:

You can use conditions and actions to launch scene timers. Then you can run actions when a timer reaches a certain value. The most useful timers are seen when used in a condition to compare the time elapsed in a timer and the action to reset a timer to 0. It is important to remember to always reset a timer prior to using it. If the timer doesn’t exist, it will be created automatically in memory.

Now this already says it all, however my experience diverges and I would like to understand why.
All I use is an event to fire if a timer has expired, and within that event I reset the timer and do whatever I need to do. And the game works.

But actually I did not initialize the timer. When does it get initialized? According to the documentation it would be initialized in the action, but then the condition would have already evaluated to true? Or does the condition initialize the timer as well?

The timer is initialized the first time it is used in an action or a condition.

That makes way more sense with my observations. In that case the documentation should get an update.

I registered to the wiki and edited that paragraph. Maybe you want to have a look at that?

1 Like