The "No UI" Challenge: Building a Pure Immersion Mode 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 "No UI" Challenge: Building a Pure Immersion Mode with Verse
Stop letting your players see their health bars, ammo counts, and that annoying minimap cluttering up their vision. Sometimes, you want the player to rely on their eyes, their ears, and their gut instinct—not a digital overlay. In this tutorial, we're going to build a "Stealth Mode" device that strips away the entire Fortnite HUD the moment a player steps into a zone. It's like going full ghost mode: no map, no health, just pure survival.
What You'll Learn
- The HUD Controller: How to use a device to toggle visibility of game elements (health, ammo, map).
- Verse Syntax Basics: How to write a simple script that reacts to a player entering a space.
- Scene Graph Awareness: Understanding that the HUD is part of the game's "scene" that can be manipulated.
- Event-Driven Logic: Triggering code when a specific game event happens (a player entering a trigger).
How It Works
Imagine the Fortnite HUD as your inventory screen. Normally, it's always open, showing you what you have. But in a stealth mission, you might want to hide your inventory so you don't accidentally bump the button and give away your position.
In UEFN (Unreal Editor for Fortnite), the HUD Controller is the device that manages this "inventory screen." By default, it's set to "Show Everything." But we can use Verse to tell that device: "Hey, when Player X enters this room, hide the Minimap, Health, and Ammo."
The Scene Graph Connection
In Unreal Engine 6 (which powers Verse), everything in the game world is part of a Scene Graph. Think of the Scene Graph as the island's skeleton. It holds every prop, every player, and every UI element in a hierarchy. The HUD isn't just a sticker on the screen; it's a digital object attached to the player's "camera" in this hierarchy. By manipulating the Scene Graph via code, we can hide or show these objects dynamically.
The Logic Flow
- Trigger: A player walks into a "Stealth Zone" (a Trigger Volume).
- Event: The game detects the collision.
- Action: Our Verse script runs.
- Result: The HUD Controller receives a command to hide specific elements.
Let's Build It
We are going to create a single Verse device called StealthModeTrigger. When a player walks into it, their HUD goes dark.
Step 1: Place the Devices
- Place a Trigger Volume (or a Mutator Zone) in your island. Make it big enough to walk into.
- Place a HUD Controller anywhere on the map. You don't need to connect it to anything manually; our code will handle it.
- Create a new Verse file in the Content Browser. Name it
StealthModeTrigger.
Step 2: The Code
Here is the complete, annotated Verse script. Copy this into your file.
# Import necessary modules
using { /Fortnite.com/Devices } # Gives us access to devices like trigger_device
using { /Verse.org/Simulation } # Gives us access to game simulation logic
using { /Fortnite.com/Characters } # Gives us access to fort_character for agent casting
using { /Verse.org/Colors } # Gives us access to color types (unused here, safe to remove)
using { /Fortnite.com/UI } # Gives us access to fort_hud_controller and hud_element_identifier types
using { /Fortnite.com/Game } # Gives us access to fort_playspace and GetHUDController
# Define the device class
# This is like building a new custom device in the Creative UI
StealthModeTrigger := class(creative_device):
# 1. Define the Trigger device we'll place in the editor
# We expose this so you can drag-and-drop a trigger_device into this device's slot
@editable
TriggerVolume : trigger_device = trigger_device{}
# 2. Define the HUD Controller
# We expose this so you can link the HUD Controller device here
@editable
HudController : hud_controller_device = hud_controller_device{}
# 3. The "On Begin" function
# This runs once when the game starts
OnBegin<override>()<suspends> : void =
# Subscribe to the trigger's TriggeredEvent for every agent who enters.
# trigger_device exposes TriggeredEvent, which fires with the triggering agent (optional).
TriggerVolume.TriggeredEvent.Subscribe(OnAgentTriggered)
# Called automatically by TriggeredEvent each time a player triggers the trigger
OnAgentTriggered(EnteredAgent : ?agent) : void =
# Unwrap the optional agent, then cast to player; fails silently if NPC or no agent
if (TheAgent := EnteredAgent?):
if (EnteredPlayer : player = player[TheAgent]):
HideHUD(EnteredPlayer)
# The function that actually hides the UI
HideHUD(TargetPlayer : player) : void =
# Hide multiple HUD elements for the specific player using the real API.
# fort_hud_controller.HideElementsForPlayer takes a player and an array of hud_element_identifier.
# We get the fort_hud_controller from the playspace.
Playspace := GetPlayspace()
HUDController := Playspace.GetHUDController()
HUDController.HideElementsForPlayer(TargetPlayer, array:
creative_hud_identifier_minimap{},
creative_hud_identifier_shields{},
creative_hud_identifier_ammo{},
creative_hud_identifier_score{})```
### Walkthrough: What Just Happened?
1. **`StealthModeTrigger := class(creative_device):`**: This creates a new "box" in your Creative UI. It's a custom device you can place anywhere.
2. **`@editable`**: This decorator marks a field as a **Property** — a slot visible in the editor's details panel where you plug in another device by dragging and dropping it.
3. **`OnBegin`**: This is an **Event**. It's a function that runs automatically when the level starts. It's like the "Start Game" button on the bus.
4. **`AgentEntersEvent.Subscribe(...)`**: This hooks a callback function to the trigger's built-in event. Every time any agent walks in, our `OnAgentEntered` function is called automatically — no manual player loop needed.
5. **`player[EnteredAgent]`**: This is a **type cast**. It attempts to interpret the generic `agent` as a `player`. If the agent is an NPC, the cast fails and the `if` block is skipped safely.
6. **`HideMinimapForPlayer` / `HideHealthAndShieldForPlayer` / etc.**: These are the real **API calls** on `hud_controller_device`. Each one targets a specific HUD element for a specific player.
### Step 3: Connect the Wires (In-Editor)
1. Place your `StealthModeTrigger` device on the map.
2. In the device's details panel, you will see two slots: **TriggerVolume** and **HudController**.
3. Drag your actual **trigger_device** into the **TriggerVolume** slot.
4. Drag your **HUD Controller** device into the **HudController** slot.
5. Press Play. Walk into the trigger. Your health bar, ammo, and minimap should vanish.
## Try It Yourself
The current code hides the HUD forever once you enter the zone. That's great for a stealth level, but what if you want it to be a toggle?
**Challenge:** Modify the code so that the HUD only hides when you **enter** the trigger, and **shows back up** when you **leave** the trigger.
*Hint:* Look for a signal called `AgentExitsEvent` on the `TriggerVolume`. You'll need to subscribe a new function that calls the matching `Show...ForPlayer` methods on `HudController`, such as `ShowMinimapForPlayer`, `ShowHealthAndShieldForPlayer`, and so on.
## Recap
You just built a device that manipulates the player's UI using Verse. You learned how to:
1. Use **`@editable` Properties** to link devices together.
2. Use **Events** (`OnBegin`, `AgentEntersEvent`) to react to gameplay.
3. Use the **HUD Controller API** to hide game elements like the minimap and health bar.
4. Understand that the HUD is part of the **Scene Graph** and can be controlled dynamically.
Now go make some players sweat by taking away their health bars. They'll thank you later (or they'll rage quit, which is also fun).
## References
- https://dev.epicgames.com/documentation/en-us/fortnite/using-hud-controller-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-hud-controller-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/removing-and-controlling-the-fortnite-default-hud-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/design-a-creature-rush-game-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/escape-room-09-inside-cabin-in-unreal-editor-for-fortnite
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add using-hud-controller-devices-in-fortnite-creative 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.