The Timer behavior simply triggers its On timer condition regularly or once after a delay. This is like using the system Every X seconds condition, or the system Wait action, except that times are kept for each instance individually. The rate of On timer triggering is affected by the time scale. The timer behavior is a more convenient alternative to adding dt to an instance variable every tick.
A single Timer behavior can keep track of multiple timers. To distinguish between them, a tag is used. A tag is simply a string, which can be anything. For example, starting a timer with tag "attack" will trigger On timer "attack", but not On timer "defend".
When a timer is stopped, or after a one-off timer triggers, it no longer exists and the timer expressions cannot be used to retrieve any information about it.
- Is timer paused
- True if a timer with the given tag has been started and then subsequently paused with the Pause/resume timer action.
- Is timer running
- True if a timer with the given tag has been started with the Start timer action. Once Stop timer is used, the timer no longer counts as running. Paused timers also count as running - use the Is timer paused condition to identify these timers separately.
- On timer
- Triggers either regularly, or once off, after a timer that was started with the same tag has reached its duration.
- Pause/resume timer
- Set a currently running timer (started with the Start timer action) either paused or resumed. When a timer is paused, it will stop triggering On timer. When resumed, it will continue triggering On timer, resuming from the time that it was paused at. In other words if a timer is set for 1 second, it is paused after 0.5 seconds, and then after some time it is resumed again, On timer will trigger 0.5 seconds after resuming.
- Start timer
- Set a new timer, or if the timer exists, re-start it with new options. Duration is the time until On timer triggers. If Type is Once, then On timer will fire once and not again until Start timer is used again; if Regular, then On timer will keep firing every Duration seconds. The tag allows multiple timers to run at once. The corresponding On timer condition must use the same tag.
- Stop timer
- Stop a timer with a specific tag. On timer will no longer trigger after this action.
- The time in seconds since On timer last triggered, for a timer with a specific tag.
- The duration in seconds for a timer with a specific tag.
- The time in seconds since a timer with a specific tag was started with the Start timer action. This is only useful with regular timers, since it will always equal the CurrentTime expression for one-off timers (after which they fire and the timer no longer exists, so these expressions return 0).
Construct 3 Manual
You are here:
Search this manual:
This manual entry was last updated on 26 Mar, 2021 at 12:45