Learn

Chapter 03 Conditions, Time & Loops

#022 Clear and Invalidate Timer

Two nodes can stop a timer. Only one remembers where it stopped.

  • 0:56 video
  • Written lesson
  • Beginner
Video lesson: Clear and Invalidate Timer, 0:56

Clear: stop for good

Clear and Invalidate Timer by Handle stops the timer for good. It also invalidates the handle: your variable no longer points to any timer. Is Timer Active by Handle now returns false. Clearing an empty handle is safe: nothing happens.

Pause: keep the time

Pausing works differently. Build a capture point: leaving the zone calls Pause Timer by Handle and the countdown freezes. Step back inside, and Unpause Timer by Handle resumes with exactly the remaining time.

Get Timer Remaining Time by Handle returns those seconds, so a capture bar can show them.

Common mistakes and details

  • Unpause after a Clear does nothing. That timer is gone; set a new one instead.
  • While paused, Is Timer Active returns false, but Is Timer Paused returns true.
  • Timers bound to an actor’s events stop when that actor is destroyed, so you don’t have to clear them yourself.

In short

Clear to cancel. Pause to keep the time.

Covered in this lesson

  • Clear and Invalidate Timer by Handle
  • Pause Timer by Handle
  • Unpause Timer by Handle
  • Is Timer Active by Handle
  • Is Timer Paused by Handle
  • Get Timer Remaining Time by Handle

Newsletter

Development updates are coming to your inbox.

The newsletter opens soon. Until then, new lessons, tools and Beach Hunters progress appear first on our channels, linked below.