The Hidden Wing: Data Layers Reveal

In this lesson you'll learn to

  • βœ“Student can organize content into World Partition data layers and activate/deactivate them at runtime (via sequencer/device) to reveal the inner Athenaeum.

Student can organize content into World Partition data layers and activate/deactivate them at runtime (via sequencer/device) to reveal the inner Athenaeum.

πŸ“– Reference & full walkthrough: The Hidden Wing: Data Layers Reveal

πŸ” Builds on: lesson 15 sequencer (data layers are driven from the sequence per the owner UI arc)

🧩 Your capstone piece: The sealed inner library wing that materializes when all pedestals are filled


Magic Layers: Build a World That Changes!

Do you want to build a Fortnite island that changes from day to night? Or maybe one where a bridge appears only when you step on a switch?

You can do this with Data Layers. Think of them like magic stickers. You can stick them on your world, peel them off, or swap them out instantly.

In this tutorial, you will learn how to use Data Layers to make a secret room appear.

What You'll Learn

  • What a Data Layer is.
  • How to put objects into different layers.
  • How to hide and show layers using Verse code.
  • How to create a "secret door" effect.

How It Works

Imagine your Fortnite island is a giant stack of clear plastic sheets. This is called the Scene Graph.

Each sheet is a Layer.

  • Layer 1 has the grass and trees.
  • Layer 2 has the house walls.
  • Layer 3 has the secret treasure chest.

When you play the game, you can turn these sheets on or off. If you turn off Layer 2, the walls disappear. If you turn on Layer 3, the treasure appears!

This is perfect for games. You can hide traps until a player gets close. You can change seasons by swapping a "Winter" layer for a "Summer" layer.

Let's Build It

We will build a simple room. There will be a door. When you touch the door, the walls will vanish, and a treasure chest will appear!

Step 1: Set Up Your Layers

  1. Open your island in UEFN.
  2. Look for the World Partition panel on the right.
  3. Click Add Data Layer. Name it Walls.
  4. Click Add Data Layer again. Name it Treasure.
  5. Place a Prop-Mover (this is our door) in the center.
  6. Place some Props (boxes or walls) around it. Put these in the Walls layer.
  7. Place a Treasure Chest prop. Put this in the Treasure layer.

Step 2: Write the Verse Code

Now, we need code to make the magic happen. We will use a Trigger. When a player walks into it, the code runs.

Copy this code into a new Verse file in your project.

# Import the tools we need
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# This is our main device
secret_door_device := class(creative_device):

    # This is the trigger pad β€” wire this in the UEFN Properties panel
    @editable
    TriggerPad : trigger_device = trigger_device{}

    # This is the list of prop devices for the Walls layer.
    # Add every wall prop_manipulator device here in the Properties panel.
    @editable
    WallProps : []prop_manipulator_device = array{}

    # This is the list of prop devices for the Treasure layer.
    # Add every treasure prop_manipulator device here in the Properties panel.
    @editable
    TreasureProps : []prop_manipulator_device = array{}

    # This runs when the game starts
    OnBegin<override>()<suspends> : void =
        # Wait for a player to touch the pad, then run on_player_touch
        TriggerPad.TriggeredEvent.Await()
        on_player_touch()

    # This function runs when someone touches the pad
    on_player_touch() : void =
        # 1. Hide the 'Walls' layer
        # This makes the walls disappear
        for (Wall : WallProps):
            Wall.Disable()

        # 2. Show the 'Treasure' layer
        # This makes the chest appear
        for (Chest : TreasureProps):
            Chest.Enable()

        # Optional: Play a sound or effect here!
        Print("Secret room opened!")```

### How the Code Works

*   **`class(creative_device)`**: This tells Verse this is a special device for your island.
*   **`TriggerPad`**: This is the object in your level that detects players. The `@editable` tag lets you wire it up in the UEFN Properties panel.
*   **`TriggeredEvent.Await()`**: This is an **Event**. It fires when a player touches the trigger. Think of it like a light switch clicking on.
*   **`prop_manipulator_device`**: This is the real UEFN device that can show or hide a single prop. You add one to the level for each wall or treasure prop, then wire them into the `@editable` arrays in the Properties panel.
*   **`.Hide()` and `.Show()`**: These are the magic commands on `prop_manipulator_device`.
    *   `.Hide()` makes the prop invisible and solid objects non-collidable.
    *   `.Show()` makes the prop reappear.

### Step 3: Connect It in UEFN

1.  Place the **secret_door_device** Creative Device in your level.
2.  Place a **Prop Manipulator** device next to every wall prop and every treasure prop in your level.
3.  In the **Properties** panel for your secret_door_device, find the `TriggerPad` slot and drag your Trigger device into it.
4.  Add each wall Prop Manipulator into the `WallProps` array, and each treasure Prop Manipulator into the `TreasureProps` array.
5.  Test your island! Walk into the trigger. Do the walls disappear? Does the chest appear?

## Try It Yourself

You did it! You made a secret room. Now, try this challenge:

**Challenge:** Add a third layer called `Obstacles`. Put some spikes in this layer. Make the spikes appear *only* when the walls disappear.

**Hint:** You need to add a new `@editable` array called `ObstacleProps` for your spike Prop Manipulator devices. Then, add another `for` loop in the `on_player_touch` function that calls `.Show()` on each one.

## Recap

*   **Data Layers** are like clear sheets in a stack.
*   You can hide or show props with Verse code using `prop_manipulator_device`.
*   Use `.Hide()` and `.Show()` to toggle visibility.
*   This makes your island feel alive and magical!

## References

*   https://dev.epicgames.com/documentation/en-us/uefn/UE/building-virtual-worlds/world-partition/world-partition-data-layers
*   https://dev.epicgames.com/documentation/en-us/uefn/UE/ue-reference-environments-and-landscapes-in-unreal-editor-for-fortnite
*   https://dev.epicgames.com/documentation/en-us/fortnite/uefn-vs-ue-in-unreal-editor-for-fortnite
*   https://dev.epicgames.com/documentation/en-us/uefn/UE/building-virtual-worlds/world-partition/world-partition-hlods
*   https://dev.epicgames.com/documentation/en-us/fortnite/streaming-and-hlods-in-unreal-editor-for-fortnite
πŸ”’

Keep going β€” free

You've read the intro. The rest of this lesson is free for members. Sign in to continue and track your progress.

Sign in free to continue this lesson
Pass the quiz above to chart this quest in your Journal.

Sources

/guides/world-partition-data-layers
Source

Biloxi Studios original lesson

Guided course

Add this lesson to your free study plan.

🧭 The Keeper’s log

Quest complete? Chart your next heading from the 🌊 The Deeps expedition.

β›΅ Take me there