← Learn library

Unreal Engine & Blueprints

CountdownTimer Part 2

Channel: CGI Nerd Unreal Engine ·

Written guide

Original CGI Nerd Unreal Engine video thumbnail
CountdownTimer Part 2CGI Nerd Unreal Engine · Video hosted on YouTube

Playing loads YouTube content. YouTube processes data after activation.

Watch on YouTube

If the player is blocked or unavailable, use Watch on YouTube.

Software: Unreal Engine

This lesson corrects the incomplete countdown from Part 1. The instructor identifies the missing seconds reset, then changes the boundary comparisons so zero can be displayed before the timer rolls to the next minute or expires.

The work remains in the side-scroller GameMode and uses debug printing. Although a HUD is mentioned at the start, it is postponed to the next video. The exact Unreal Engine release is unidentified, and the recorded tests establish boundary behavior rather than precision against an external clock.

Reset seconds after a continuing minute rollover

At 00:01–02:00, the instructor adds Set Seconds with a value of 59 to the path that continues after subtracting a minute. That reset occurs before calling Countdown Timer again.

Without the reset, Part 1’s graph continues decrementing a nonpositive seconds value instead of starting the next minute. The new assignment restores the seconds state for the next cycle.

A short test begins with ten seconds so the rollover can be reached quickly. It now returns to 59, but skips displaying zero. Fixing the stored value exposes a separate issue in the transition condition and display order.

Separate formatting from the rollover condition

During 02:00–04:04, the formatting and Print String nodes are collapsed into a Print Time function. Calls are placed on the continuing paths near the next Countdown Timer call rather than keeping the original print at the top of the event.

The first test after moving the print still does not show zero. This is useful evidence: changing display placement alone does not repair a state transition that happens too early.

Inspect both the state and the display call. A correctly formatted message can only show the value that the countdown logic leaves available at that point.

Change both termination comparisons to strict less-than tests

At 04:04–07:02, the seconds comparison changes from less-than-or-equal-to-zero to strictly less than zero. That lets zero remain a valid displayed seconds state; rollover happens on the later update that crosses below zero.

Testing now shows the sequence reaching zero before returning to 59. The instructor also checks that the minute count decreases on that transition.

The minute termination condition is revised in the same way: zero minutes remains valid, and the expiration branch is reached when the decremented minute value goes below zero. A test initialized with zero minutes and ten seconds displays the countdown through zero and then prints the expiration message.

The comparisons explain the observed correction, but they also mean the internal calculation can briefly produce negative values. This lesson uses selected debug-print paths and does not yet clamp the stored terminal values back to zero.

Keep the corrected countdown separate from its later HUD

During 07:02–07:23, the instructor ends the repair lesson and explicitly moves the HUD work to another video. The completed work here is the missing reset, reorganized print function, and revised zero-boundary behavior.

Check a minute transition and a final expiration separately. A timer can roll correctly while ending at the wrong time, or expire while hiding an incorrect intermediate value. The recorded short tests cover both visible paths but do not certify drift-free timing, pause handling, or duplicate-start protection.

Part 3 creates a continuously bound display and exposes the negative terminal state that the debug output did not show; that later lesson explicitly resets the stored minute and second values on expiration. Do not assume that final display correction is already present in this Part 2 graph.