The "Press Start" Moment: Building a Custom Menu with Verse
Unverified — this example may not compile as-is.
The Verse code below did not pass our automated compile check, so it isn't marked verified and is hidden from the guide listing. The explanation may still be useful, but treat the code as a draft and adapt it before use.
The "Press Start" Moment: Building a Custom Menu with Verse
You know that feeling when you drop into a chaotic island, but the first thing you see is a blank void and a generic "Play" button? Boring. You want your island to feel like a real game, with a proper intro sequence, a splash screen, and a custom menu that looks like it cost millions to develop.
In this tutorial, we're going to build the Game Menu component of a Title Sequence. We aren't just slapping a button on the screen; we're using Verse to manage the timing, the camera transitions, and the UI state. Think of this as building the "Lobby" before the match actually starts. By the end, you'll have a script that says, "Welcome to my world," waits for the player to read the hype, and then lets them hit "Start" when they're ready.
What You'll Learn
- The Scene Graph & Entities: How Verse sees the objects in your level (the "Who" and "Where").
- Constants vs. Variables: Setting up your cameras and menus so they don't change unexpectedly.
- Events & Functions: The "Trigger" and "Action" logic that moves the game from Intro → Menu → Gameplay.
- UI Widgets: Creating a custom Pop-Up Dialog that actually looks good.
How It Works
Before we write a single line of code, let's translate the programming concepts into Fortnite mechanics.
1. The Scene Graph: Your Island's Skeleton
In Unreal Engine, everything in your level is part of the Scene Graph. This is just a fancy way of saying "the hierarchy of all objects."
- Game Analogy: Imagine your island is a house. The Scene Graph is the blueprint showing where the walls, doors, and furniture are placed.
- Entity: An Entity is any object in that blueprint (a player, a prop, a camera, a Verse device). It's like a specific piece of furniture.
- Component: A Component is an attribute attached to an Entity. If the Entity is the "Player," the Components are "Health," "Shield," and "Loadout." If the Entity is a "Camera," the Components are "Position," "Rotation," and "FOV."
When you write Verse, you are manipulating these Entities and their Components. You don't just say "move the camera"; you say "take the Entity named MyCamera, find its Transform Component, and change its Location."
2. Constants: The Locked Loot
In programming, a Constant is a value that is set once and never changes.
- Game Analogy: This is like the map seed or the starting loot pool. Once the island loads, those rules are fixed. You don't want your intro camera changing position randomly every time a player joins, right? That would be like the Battle Bus teleporting to different spots every match. We use Constants for things that are permanent, like the ID of our Intro Camera.
3. Variables: The Storm Timer
A Variable is a value that can change during the game.
- Game Analogy: This is your Storm Timer or Elimination Count. At the start, the eliminations are 0. Then they go to 1, then 2. In our Title Sequence, we'll use a variable to track whether the player has "Started" the game or is still watching the intro.
4. Events: The Trigger Device
An Event is something that happens, triggering code to run.
- Game Analogy: This is exactly like a Trigger Device. When a player walks into the zone, the Trigger fires. In Verse, we listen for events like
OnBeginPlay(when the game starts) orOnInput(when a player presses a button).
5. Functions: The Item Granter
A Function is a block of code that does a specific job.
- Game Analogy: Think of this as an Item Granter or a Prop Mover. You set it up once (the function definition), and then you can "fire" it whenever you want. If you have a function called
ShowMenu(), calling that function is like pressing the "Fire" button on the Item Granter to give the player a gun.
Let's Build It
We are going to create a Verse device that acts as the Director of our Title Sequence. It will:
- Wait for the game to start.
- Show a splash screen (using a camera).
- Switch to the Game Menu (using a Pop-Up Dialog).
- Wait for the player to press "Start" to begin the actual island.
Step 1: Create the UI Widget (The Visuals)
Before coding, we need the menu.
- In UEFN, go to the Content Browser → Right-click → Widget Blueprint.
- Name it
WBP_Game_Menu. - Open it. Add a Size Box (this gives the panel size).
- Add an Overlay inside the Size Box.
- Inside the Overlay, add a Button. Label it "START GAME".
- Save and close. This widget is now an Entity in your scene.
Step 2: The Verse Code
Create a new Verse Device in your level. Name it TitleSequenceDirector. Open the code editor and paste this in.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# We are defining a "Device" which is a reusable block of Verse logic.
# Think of it as a custom Device type you can place in your level.
title_sequence_device := class(creative_device):
# --- CONSTANTS: The "Locked" Settings ---
# These are like the fixed map boundaries. They don't change.
# We link this to a Fixed Point Camera in the editor.
# Drag your gameplay_camera_fixed_point_device from the level into this slot.
@editable
SplashCamera : gameplay_camera_fixed_point_device = gameplay_camera_fixed_point_device{}
# We link this to our Pop-Up Dialog Device in the editor.
# This is the "Loot Drop" container for our menu.
@editable
MenuDialog : popup_dialog_device = popup_dialog_device{}
# --- VARIABLES: The "Changing" State ---
# This is like the "Game State" flag. Is the game started or not?
# Starts as FALSE (game hasn't started).
var GameStarted : logic = false
# --- FUNCTIONS: The Actions ---
# This function is like a "Prop Mover" that moves the camera.
# It activates the splash camera sequence, waits, then shows the menu.
StartIntroSequence()<suspends> : void =
# "Print" is like shouting in chat. It shows text in the debug console.
Print("Intro sequence started!")
# We tell the splash camera device to activate (play its cinematic view).
# In Verse, we call methods on the device reference to change its state.
SplashCamera.AddToAll()
# We wait 3 seconds (like a storm timer) before showing the menu.
# This gives the player time to absorb the hype.
Sleep(3.0)
# Now we show the menu.
ShowMenu()
# This function shows the Pop-Up Dialog device we configured in the editor.
ShowMenu() : void =
# Show the dialog for every player currently in the session.
# GetPlayspace().GetPlayers() returns all active players.
for (Agent : GetPlayspace().GetPlayers()):
# Show the pop-up dialog to each player.
# Configure the dialog's message and button text in the editor's
# device properties panel, or via set_text / set_option_button calls.
MenuDialog.Show(Agent)
# --- EVENTS: The Triggers ---
# This function runs automatically when the level begins.
# It's like the "On Begin Play" event on a Trigger.
OnBegin<override>() <suspends> : void =
# Wire up the dialog's primary button so pressing it starts the game.
# ButtonClickedEvent(0) fires when the player clicks the first button.
MenuDialog.ButtonClickedEvent(0).Subscribe(OnStartPressed)
# Start the whole sequence!
StartIntroSequence()
# This function runs when a player clicks the primary button on the dialog.
# It's like the "On Interact" event.
# note: popup_dialog_device button events pass the interacting agent directly.
OnStartPressed(Agent : agent) : void =
# If the game hasn't started yet...
if (GameStarted = false):
# Mark the game as started (change the variable).
set GameStarted = true
# Hide the menu (turn off the light).
MenuDialog.Hide(Agent)
# Print a message to debug.
if (Player := player[Agent]):
Print("Game Started!")
# HERE IS WHERE YOU WOULD ADD CODE TO:
# 1. Spawn the player in the game area.
# 2. Give them weapons.
# 3. Start the storm.
# For now, we just log it!```
### Walkthrough: What Just Happened?
1. **`title_sequence_device := class(creative_device):`**
We defined a new **Class**. Think of this as designing a new **Creative Device** type. Just like you can place a "Prop Mover" or a "Switch," we are creating a "Title Sequence Director" device.
2. **`SplashCamera` and `MenuDialog` (Constants/Devices)**
In the UEFN editor, you will drag and drop your actual **Cinematic Sequence Camera** and **Pop-Up Dialog** devices into the slots for these fields. Verse connects to them. It's like wiring a Trigger to a Door. The Verse code is the wire; the devices are the hardware.
3. **`var GameStarted : logic = false` (Variable)**
This is our state tracker. Initially, `false` means "Intro is playing." When it becomes `true`, the intro is over.
4. **`OnBegin<override>()` (Event)**
This is the most important part. When the level loads, Verse automatically calls this function. It's the "On Begin Play" trigger. It subscribes to the dialog's button event and then calls `StartIntroSequence()`.
5. **`StartIntroSequence` (Function)**
This function orchestrates the timeline. It tells the camera device to activate its splash view, waits 3 seconds via `Sleep`, then calls `ShowMenu()`.
6. **`ShowMenu` (Function)**
This interacts with the Pop-Up Dialog. It loops over every player in the session and calls `.Show(Agent)` for each one, making the UI appear on each player's screen.
7. **`OnStartPressed` (Event)**
When the player clicks the "Start Game" button on the dialog, this function runs. It checks if `GameStarted` is false. If so, it sets it to true, hides the menu, and logs the event.
## Try It Yourself
You've built the skeleton. Now let's add some chaos.
**Challenge:** Add a "Skip Intro" feature.
* **Hint:** You can listen for a specific key press or button click. In Verse, you can check for input events. Try adding an `if` statement in your `OnStartPressed` function that checks if the player pressed a specific button (like "Skip") and, if so, immediately calls `ShowMenu()` without waiting for the 3-second timer.
* **Bonus:** Add a second button to the widget called "QUIT" that subscribes to `MenuDialog.SecondaryButtonSignaledEvent` and calls `GetPlayspace().GetPlayers()` to iterate players and teleport them to an exit pad.
## Recap
* **Scene Graph:** The hierarchy of all objects (Entities) and their attributes (Components).
* **Constants:** Fixed settings (like your intro camera) that don't change.
* **Variables:** Changing states (like `GameStarted`) that track progress.
* **Functions:** Reusable actions (like `ShowMenu()`) that do specific jobs.
* **Events:** Triggers (like `OnBegin` or `OnStartPressed`) that start your code running.
You now have the foundation for a professional Title Sequence. You're not just dropping players into a void; you're guiding them through an experience. Next, you'll want to learn how to transition from this menu to the actual gameplay loop, spawning players and starting the storm. But for now, enjoy the fact that your island has a proper "Press Start" screen.
## References
- https://dev.epicgames.com/documentation/en-us/fortnite/title-sequence-4-creating-the-game-menu-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/uefn/making-a-title-sequence-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/making-a-title-sequence-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/title-sequence-5-setting-up-the-devices-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/title-sequence-1-coding-the-verse-device-in-unreal-editor-for-fortnite
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add title-sequence-4-creating-the-game-menu-in-unreal-editor-for-fortnite 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
- title-sequence-4-creating-the-game-menu-in-unreal-editor-for-fortnite ↗
- making-a-title-sequence-in-unreal-editor-for-fortnite ↗
- making-a-title-sequence-in-unreal-editor-for-fortnite ↗
- title-sequence-5-setting-up-the-devices-in-unreal-editor-for-fortnite ↗
- title-sequence-1-coding-the-verse-device-in-unreal-editor-for-fortnite ↗
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.