Official Samples Deconstructed: Two Shapes of loop + Sleep
Lesson 15's heartbeat mode is no teaching toy — Epic has two official tutorials that showcase exactly the two big shapes loop + Sleep takes in real projects: the metronome that runs the global rhythm, and the contraption that opens and closes on a cycle. This page lands the syntax on something you can actually play.
1. One Pattern, Two Shapes
Lay out every loop + Sleep in a real project, and nearly all of them sort into two drawers:
- The global metronome: the whole match has one main loop (or very few), driving round progression, timing, and periodic scoring — it is the game's heart, and its rhythm is the gameplay rhythm;
- The periodic contraption: each gadget carries its own small loop, performing a paired action on a fixed cycle — platforms that vanish and reappear, doors that open and shut, lights that blink on and off; they are the pulses scattered across the level.
Epic happens to have one tutorial for each: Verse Starter series part 6, "Managing the Game Loop", covers the former; "Disappearing Platform on Loop" covers the latter. Put together, they are the graduation destination of Lesson 15's heartbeat_device.
2. Shape One: The Game's Main Loop (Verse Starter 06)
The core idea of "Managing the Game Loop" is to organize a game session as one loop inside the device entry point OnBegin (the equivalent of Event BeginPlay; <suspends> means it can wait): each lap is one round (or one beat), the body runs "round start → gameplay → round wrap-up" in order, and Sleep controls the pacing between laps. The skeleton looks like this:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
round_manager_device := class(creative_device):
var Round:int = 0
OnBegin<override>()<suspends>:void =
loop:
set Round += 1
Print("Round {Round} begins")
# ... this round's gameplay logic ...
Sleep(30.0) # 30 seconds per round
Print("Round {Round} wrap-up")
Sleep(5.0) # 5-second break between rounds
The key takeaway of this shape is the mental model: the game's timeline no longer lies scattered across a dozen event nodes (the kind you Bind out one by one), but sits in one top-to-bottom loop you can read straight through — what happens first, what happens next, and how long between steps, all at a glance. Need to end the match early? Add a condition inside the lap that goes to break. Need dynamic pacing? Swap Sleep's seconds for a variable. Every trick from Lesson 15 clicks into place here.
3. Shape Two: The Timed Disappearing Platform
"Disappearing Platform on Loop" shrinks the same pattern down to a single gadget device: the platform shows for a few seconds, hides for a few, over and over, and players must time their jumps to the rhythm. The loop body is just "a paired action + two Sleeps":
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
blink_platform_device := class(creative_device):
OnBegin<override>()<suspends>:void =
loop:
Print("Platform is here — hop on!")
# call the prop's show API here
# Verify against the Verse API Reference
Sleep(3.0) # platform stays for 3 seconds
Print("Platform gone — 2 seconds of thin air")
# call the prop's hide API here
# Verify against the Verse API Reference
Sleep(2.0)
Notice that the entire gadget's feel lives in two numbers: Sleep(3.0) is the player's reaction window, Sleep(2.0) is the punishment interval. To build a difficulty curve, just flip on @editable for those two second-count variables (that's the little Instance Editable eye on a Blueprint variable) and make them floats; then drag the device into the level, and designers tune them right in the Details panel without touching a single node.For which exact node to wire or function to call for showing/hiding the prop, defer to the official tutorial page and the digest files generated in your project — this page deliberately leaves them blank rather than making up names on Epic's behalf.
Remember Lesson 15's paired operations under defer? Show/hide is exactly that kind of pair. If your gadget loop has a break exit (say, it powers down when the game ends), use defer to guarantee "restore the platform to visible before leaving the loop body" — and you avoid the awkwardness of a platform that vanishes forever. That's two lessons shaking hands inside one device.
You want the disappearing platform to stay longer and vanish for less time, to lower the difficulty. What do you change?
4. Sources
This page is compiled from Epic's official tutorials — follow along with the originals if you can: