Build a Maze That Moves!
Tutorial beginner compiles

Build a Maze That Moves!

Updated beginner Code verified

Build a Maze That Moves!

Have you ever walked into a room and felt like the walls were watching you? Or maybe you found a secret door hidden behind a bookshelf? In Fortnite, you can build those feelings! Today, we will learn how to make a maze that changes. We will use Verse code to move walls around. This makes your island feel alive. It is like magic, but it is actually coding!

What You'll Learn

  • What a variable is (it is like a box that holds a changing value).
  • How to use a function (it is like a recipe for doing a task).
  • How to connect code to game devices.
  • How to make walls move to surprise players.

How It Works

Level design is like building a LEGO castle. You want the castle to be fun to explore. One way to make it fun is to change it. Imagine a hallway. If it stays the same, it is boring. But if a wall slides open when you step on a rug? That is exciting!

We will use a Prop Mover device. This device can move objects. We will tell the Prop Mover to move a wall using Verse code.

Think of a variable like a remote control. You can change the channel. In our game, we will have a variable called isOpen. It can be true or false. If isOpen is true, the wall moves. If it is false, the wall stays still.

We will also use an Event. An event is like a trigger. When a player steps on a specific tile, the event fires. This tells our code: "Hey! Move the wall!"

Here is the plan:

  1. Place a wall in your island.
  2. Place a Prop Mover on it.
  3. Place a Trigger Volume where players will walk.
  4. Write Verse code to move the wall when the trigger is hit.

Let's Build It

First, open UEFN. Go to your island. Place a simple wall. Now, add a Prop Mover device to that wall. Make sure the wall is moving in the direction you want it to slide. You can test this in the editor. It should slide smoothly.

Next, place a Trigger Volume device. This is an invisible box. When a player walks into it, it sends a signal. Place this box right in front of the wall.

Now, let's write the Verse code. This code connects the Trigger to the Prop Mover.

# This is our main script file
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# This is our main class. It holds all our code.
MovingWallScript := class(creative_device):

    # This is a VARIABLE. It holds the Prop Mover device.
    # We will set this in the editor later.
    @editable
    WallMover: prop_mover_device = prop_mover_device{}

    # This is a VARIABLE for the Trigger.
    @editable
    MoveTrigger: trigger_device = trigger_device{}

    # This function runs when the game starts.
    OnBegin<override>()<suspends>: void =
        # We connect the Trigger to a function.
        # When the trigger is activated, it calls MoveWall.
        MoveTrigger.TriggeredEvent.Await()
        MoveWall()

    # This is a FUNCTION. It is the recipe for moving the wall.
    MoveWall()<suspends>: void =
        # This line moves the wall!
        # It tells the Prop Mover to start moving.
        WallMover.Begin()

        # We wait for 2 seconds.
        # This gives time for the wall to move.
        Sleep(2.0)

        # Now we move the wall back!
        WallMover.Reverse()```

Let's look at the important parts.

The line `WallMover: prop_mover_device` is a variable. It is a placeholder. You will drag your actual Prop Mover device into this slot in the editor.

The line `MoveTrigger.TriggeredEvent.Await()` is the event. It says: "Wait until the trigger fires, then run the `MoveWall` function."

The function `MoveWall` does the work. It calls `MoveToEnd()`. This makes the wall slide. Then it waits. Then it calls `MoveToStart()`. This makes the wall slide back to its original spot.

This creates a loop of surprise. The player walks in. The wall moves. They see what is behind it. The wall closes again.

## Try It Yourself

You did it! You made a moving wall. Now, try to make it harder.

**Challenge:** Add a second wall behind the first one. Make the second wall move *after* the first one moves.

**Hint:** You can add another variable for the second wall. You can also add another event. Or, you can add a second `Sleep()` in your code to wait longer before moving the second wall.

Think about the order of events. What happens if they move at the same time? What happens if they move one after the other? Experiment and see!

## Recap

Level design is about guiding the player. You can use code to make your levels dynamic. Variables hold your devices. Functions tell them what to do. Events start the action. By combining these, you can create mazes that change. This keeps players curious and excited. Keep building and keep coding!

## References

*   https://dev.epicgames.com/documentation/en-us/fortnite/the-walking-dead-universe-level-design-in-unreal-editor-for-fortnite
*   https://dev.epicgames.com/documentation/en-us/uefn/verse-starter-template-2-defining-boards-for-game-in-unreal-editor-for-fortnite
*   https://dev.epicgames.com/documentation/en-us/fortnite-creative/level-design-best-practices-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite/level-design-best-practices-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite-creative/pinbrawl-in-fortnite-creative

Verse source files

Turn this into a guided course

Add Level Design Tips 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