A countdown timer.
    public class Timer : Node

Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or “one shot” mode.

Inheritance Chain


    public Timer()


    "timeout" ()

Emitted when the Timer reaches 0.


    public bool Autostart { get; set; }

If true, Timer will automatically start when entering the scene tree. Default value: false.

    public bool OneShot { get; set; }

If true, Timer will stop when reaching 0. If false, it will restart. Default value: false.

    public bool Paused { get; set; }

If true, the timer is paused and will not process until it is unpaused again, even if Start() is called.

    public TimerProcessMode ProcessMode { get; set; }

Processing mode. Uses TIMER_PROCESS_* constants as value.

    public float TimeLeft { get; }

The timer’s remaining time in seconds. Returns 0 if the timer is inactive.

    public float WaitTime { get; set; }

Wait time in seconds.


    public float GetTimeLeft()

Getter for TimeLeft

    public TimerProcessMode GetTimerProcessMode()

Getter for ProcessMode

    public float GetWaitTime()

Getter for WaitTime

    public bool HasAutostart()

Getter for Autostart

    public bool IsOneShot()

Getter for OneShot

    public bool IsPaused()

Getter for Paused

    public bool IsStopped()

Returns true if the timer is stopped.

    public void SetAutostart(bool enable)

Setter for Autostart

    public void SetOneShot(bool enable)

Setter for OneShot

    public void SetPaused(bool paused)

Setter for Paused

    public void SetTimerProcessMode(TimerProcessMode mode)

Setter for ProcessMode

    public void SetWaitTime(float timeSec)

Setter for WaitTime

    public void Start()

Starts the timer. This also resets the remaining time to wait_time.

Note: this method will not resume a paused timer. See Paused.set.

    public void Stop()

Stop (cancel) the Timer.

Inner Types


Name Value Description
Physics 0 Update the Timer during the physics step at each frame (fixed framerate processing).
Idle 1 Update the Timer during the idle time at each frame.