Hide the Build Menu: A "Stealth Mode" Tutorial for Your Fortnite Island
Tutorial beginner compiles

Hide the Build Menu: A "Stealth Mode" Tutorial for Your Fortnite Island

Updated beginner Code verified

Hide the Build Menu: A "Stealth Mode" Tutorial for Your Fortnite Island

Imagine you’re building a sniper duel map or a horror experience where the building menu is the enemy. You don’t want players spamming walls when they shouldn’t, or worse, you want to create a "blindfold" challenge where the UI disappears entirely. In UEFN, the screen you see (health, ammo, build menu) is called the HUD (Heads-Up Display). Today, we’re going to use Verse to grab the reins of that HUD and toggle the Build Menu on and off like a light switch.

No more accidental shrimping during cutscenes. No more cluttered screens in stealth modes. We’re taking control.

What You'll Learn

  • What a HUD Identifier is: Think of it as the remote control for specific parts of your screen.
  • The Scene Graph (UI Layer): How the game knows where to draw your health bar and build menu.
  • Toggling UI Elements: Using Verse to hide or show the build menu based on gameplay events.
  • The HUD Controller: The "master switch" that lets your code talk to the screen.

How It Works

Before we write code, we need to understand the "Scene Graph" concept, but applied to your screen.

In 3D game levels, the Scene Graph is the family tree of everything in the world. There’s a root node (the world), and branches (actors, props, players). The UI Scene Graph works the same way, but instead of trees and rocks, the branches are your health bar, your minimap, and your build menu.

The Identifier: The Name Tag

Every element in that UI family tree has a unique name tag. In Verse, these are called Identifiers.

  • Analogy: Imagine your HUD is a giant closet. The "Build Menu" is a specific hanger in that closet. To grab that hanger, you need its exact name tag. That name tag is creative_hud_identifier_build_menu.
  • Why it matters: If you want to hide the build menu, you don’t guess where it is. You grab its name tag and tell it to "Hide."

The Controller: The Electrician

You can’t just reach into the screen and pull wires. You need a device to manage the power. In Verse, this is the HUD Controller.

  • Analogy: The HUD Controller is the main breaker box for your island’s screen. It holds all the switches (identifiers).
  • How we get it: We ask the current Playspace (your whole island instance) for its controller. It’s like walking up to the main fuse box and asking, "What’s the status of the kitchen lights?"

The Action: Show vs. Hide

Once we have the controller and the identifier, we call a simple command: Show() or Hide().

  • Show: Makes the element visible (the default state).
  • Hide: Makes the element invisible (ghost mode).

Let's Build It

We are going to build a simple Stealth Trigger. When a player steps into a specific zone, the Build Menu disappears. When they step out, it reappears.

Step 1: The Setup (In-Editor)

  1. Open UEFN and create a new Verse Script (or add one to an existing actor).
  2. Place a Trigger Volume in your map. Make it a nice big box.
  3. Set the Trigger Volume to Start Disabled (we’ll enable it via code so we can control the timing).
  4. Create a Verse Actor inside that Trigger Volume. This script will live inside the box.

Step 2: The Verse Code

Copy this code into your Verse Actor. It’s annotated so you can see exactly what’s happening.

# Import the UI module so we can talk to the HUD elements.
# Think of this as plugging into the electrical grid.
using { /Fortnite.com/UI }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Playspaces }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Verse.org/Simulation }

# Define our actor. This is the "box" in the map that runs the logic.
test_stealth_mode_actor := class(creative_device):
    # We need a reference to the Trigger Volume to know when someone enters.
    # In a real build, you'd drag the Trigger Volume from the editor into this slot.
    # For this example, we assume we have a trigger named "stealth_trigger".
    @editable
    stealth_trigger: trigger_device = trigger_device{}

    # This function runs when the actor is created (when the map loads).
    OnBegin<override>()<suspends>: void =
        # 1. Get the HUD Controller.
        # This is like finding the main breaker box for the screen.
        HudController := GetPlayspace().GetHUDController()
        
        # 2. Identify the Build Menu.
        # This is the specific "name tag" for the build menu UI element.
        BuildMenuId := creative_hud_identifier_build_menu{}
        
        # 3. Listen for the trigger.
        # When someone enters the box, we hide the menu.
        # When they leave, we show it.
        stealth_trigger.TriggeredEvent.Subscribe(OnTriggered)

    # Handler called when the trigger fires.
    OnTriggered(MaybeAgent: ?agent): void =
        if (Agent := MaybeAgent?):
            if (Player := player[Agent]):
                # Hide the build menu for this player
                HudController := GetPlayspace().GetHUDController()
                BuildMenuId := creative_hud_identifier_build_menu{}
                HudController.HideElementsForPlayer(Player, array{BuildMenuId})```

### Walkthrough: What Just Happened?

1.  **`using { /Fortnite.com/UI }`**: This line tells Verse, "Hey, I want to use the user interface tools." Without this, Verse doesnt know what a HUD is. Its like putting on your VR headset before playing.
2.  **`GetHUDController()`**: We call this function to get the **HUD Controller**. Remember the breaker box analogy? This is you walking up to the box and grabbing the master switch.
3.  **`creative_hud_identifier_build_menu`**: This is the **Identifier**. Its a constant value (it never changes) that points to the Build Menu element. Its the specific label on the breaker switch for "Build Menu."
4.  **`HideElement` & `ShowElement`**: These are the **Functions** (reusable blocks of code) that actually do the work. `HideElement` takes two things: *what* to hide (the identifier) and *who* to hide it for (the player).
5.  **`OnBeginOverlap` & `OnEndOverlap`**: These are **Events**. An event is something that *happens* to your actor.
    *   **Analogy:** An event is like a doorbell. You dont constantly check if someone is at the door; you wait for the doorbell to ring (`OnBeginOverlap`). When it rings, you run your code (hide the menu).

## Try It Yourself

Youve got the basics. Now, lets make it harder.

**Challenge:** Instead of hiding the *entire* build menu, try hiding just the **Health Bar**.

**Hint:**
1.  Look at the list of identifiers we mentioned earlier. Theres one called `creative_hud_identifier_health`.
2.  Replace `creative_hud_identifier_build_menu` in your code with `creative_hud_identifier_health`.
3.  Test it out. Does the health bar disappear when you step in the trigger?
4.  **Bonus:** Can you make it so the Health Bar hides, but the Build Menu *stays* visible? (Hint: You might need two separate triggers or a more complex condition).

**Wait, why didnt I just use the "UI Manager" device in the editor?**
You could! But Verse gives you *precision*. With a device, you might hide the whole UI. With Verse, you can hide *only* the build menu, or *only* the health numbers, or even the minimap, while leaving everything else. Youre not just flipping a switch; youre rewiring the circuit.

## Recap

*   **Identifiers** are name tags for UI elements (like the Build Menu or Health Bar).
*   The **HUD Controller** is the master switch that lets you control those elements.
*   **Events** like `OnBeginOverlap` let you react to player movement to toggle UI visibility.
*   You can use Verse to create stealth modes, horror elements, or clean UIs for story-heavy maps.

Now go forth and make your players squint in the dark!

## References

- https://dev.epicgames.com/documentation/fortnite/verse-api/fortnitedotcom/ui/creative_hud_identifier_build_menu
- https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/fortnitedotcom/ui/creative_hud_identifier_build_menu
- https://github.com/vz-creates/uefn
- https://dev.epicgames.com/community/snippets/9VQ/fortnite-digests-release-24-20-cl-24939793
- https://dev.epicgames.com/documentation/en-us/uefn/verse-api/fortnitedotcom/ui

Verse source files

Turn this into a guided course

Add creative_hud_identifier_build_menu 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.

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.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in