Don't Let the Storm Eat Your Victory: Mastering the Verse Timer
Don't Let the Storm Eat Your Victory: Mastering the Verse Timer
So, you’ve built the ultimate arena. You have traps that delete players faster than you can say "Oof," and loot drops that make even the most hardened grinders weep with joy. But here’s the problem: your island never ends. Players just keep running around in an eternal loop of combat, or worse, they sit in the lobby because there’s no pressure to finish.
In Fortnite, time is the most dangerous weapon in the game. The Storm doesn’t wait for you to find your third shotgun. Neither should your island. Today, we’re going to use the Timer Device in Verse to create a hard stop—a moment where the game says, "Time’s up, loser," and forces a reset or declares a winner. We’re going to build a system where the match has a heartbeat, and when that heart stops beating, the game ends. No more infinite grinding. Just pure, timed chaos.
What You'll Learn
By the end of this tutorial, you will be able to:
- Understand what a Timer Device is and why it’s the backbone of any competitive mode.
- Learn how to connect a Timer to an End Game device using Events (the game’s way of shouting "Hey!").
- Configure the Timer’s settings so it counts down exactly how you want, without showing off a giant digital clock on the screen.
- Write a basic Verse script that listens for the timer to hit zero and triggers the game-over sequence.
How It Works
Think of the Timer Device as your Storm timer, but instead of closing in on players, it’s counting down to the end of the match. In Fortnite Creative, you’ve probably used the standard Timer device before to trigger a door or spawn a wave. In Verse, we treat this device not just as a clock, but as a signal generator.
Here is the core concept: Events.
In programming, an Event is like a notification or a ping. Imagine you’re playing a team mode. You don’t constantly check every second if your teammate has been eliminated. Instead, the game sends a signal (an event) saying, "Teammate Eliminated." You react to that signal.
The Timer Device works the same way. It doesn’t just "count." When it hits zero, it fires an Event. We need to write a small piece of code (a Function) that listens for that specific event. When the event fires, our function runs, and we tell the End Game device to shut down the match.
The Scene Graph Connection
Before we look at code, let’s talk about the Scene Graph. This sounds fancy, but it’s just the family tree of your island. Every device (Timer, End Game, Spawner) is an Entity (a distinct object in the world). These entities are organized in a hierarchy.
When we write Verse code, we are essentially giving instructions to specific entities in this hierarchy. We need to grab the Timer entity, tell it to start, and then link its "finished" signal to the End Game entity’s "stop" command.
Let's Build It
We are going to build a simple "Last Man Standing" timer. When the timer hits 0:00, the game ends immediately.
Step 1: Place Your Devices
- Open UEFN and place an End Game device somewhere safe.
- Place a Timer device nearby.
- Crucial Step: In the Timer’s settings, set Visible During Game to Hidden. We don’t want a giant countdown clock ruining the immersion. We want the tension, not the UI.
Step 2: The Verse Code
In UEFN, you can attach Verse code to these devices. We’ll attach a script to the End Game device that listens to the Timer.
Here is the code. Don’t panic at the syntax—we’ll break it down line by line.
# This script attaches to the End Game device.
# It tells the End Game device: "Listen to the Timer. When it finishes, YOU stop the game."
using { /Fortnite.com/Devices }
end_game_device: EndGameDevice = EndGameDevice{}
# This is the "Event Handler."
# Think of it as a trap trigger.
# We are listening for the timer's "OnTimerEnd" event.
on_timer_finished(timer: TimerDevice) -> unit:
# When the timer hits zero, this code runs.
# We call the EndGame() function on our End Game device.
end_game_device.EndGame()
# This is the "Setup" function.
# It runs once when the island starts.
init() -> unit:
# 1. Find the Timer device in the scene graph.
# We assume we have a reference to the Timer.
# In a real setup, you might link this in the editor or via a variable.
# For this example, let's assume we have a Timer variable named 'my_timer'.
my_timer: TimerDevice = TimerDevice{}
# 2. Configure the Timer.
# Set the duration to 60 seconds.
my_timer.SetDuration(60.0)
# Start the timer immediately when the game starts.
my_timer.Start()
# 3. Connect the Event.
# We are telling the timer: "When you end, call on_timer_finished."
# This creates the link between the two devices.
my_timer.OnTimerEnd += on_timer_finished
Walkthrough: What Just Happened?
using { /Fortnite.com/Devices }: This is like loading the "Creative Tools" menu. It gives our code access to devices likeEndGameDeviceandTimerDevice.end_game_device: EndGameDevice = EndGameDevice{}: This creates a Variable (a container for data) namedend_game_device. Think of this like picking up a specific controller. We’ve defined that this variable holds the End Game device.on_timer_finished(timer: TimerDevice) -> unit:: This is a Function. A function is a block of code that does a specific job. This one is special because it’s an Event Handler. It only runs when something specific happens. Here, it waits for the timer to finish. Theunitreturn type just means "this function doesn’t give back any data, it just does stuff."end_game_device.EndGame(): This is the action. When the timer hits zero, we execute theEndGame()command on our End Game device. This is the equivalent of pressing the big red "Game Over" button.init(): This is the Initialization function. It runs once when the map loads. It sets up the timer (60 seconds) and starts it.my_timer.OnTimerEnd += on_timer_finished: This is the most important line. It binds the event. It says, "Hey Timer, when yourOnTimerEndevent fires, run theon_timer_finishedfunction." This is how we connect the two devices without them touching physically.
Try It Yourself
Now that you’ve seen how the timer triggers the end game, let’s make it more interesting.
Challenge: Modify the code so that when the timer hits zero, instead of just ending the game, it first plays a sound effect (like a "Game Over" horn) and then ends the game.
Hint: You can use the PlaySound() function on the End Game device or a separate Sound Device before calling EndGame(). Look up how to trigger sounds in Verse.
Stuck?
Think about the order of operations. If you want the sound to play before the screen goes black, which line of code needs to come first in your on_timer_finished function?
Recap
- The Timer Device is your Storm timer. It counts down and fires an Event when it hits zero.
- Events are signals that tell your code to run specific Functions.
- You use Verse to bind these events together: "When Timer Ends, End Game."
- Always configure your Timer’s Visible During Game setting to Hidden if you want a clean, professional look.
Now go build an island where time is the enemy. And remember: if you don’t set a timer, your players will outlive the sun.
References
- https://dev.epicgames.com/documentation/en-us/fortnite/party-game-4-reusable-game-manager-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/uefn/verse-parkour-template-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/verse-parkour-template-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/fortnite/verse-parkour-template-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/using-timer-devices-in-fortnite-creative
Verse source files
- 01-fragment.verse · fragment
Turn this into a guided course
Add The Timer Device used to end the game after a certain amount of time. to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
References
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.