Beyond Devices: First Look at Scene Graph Entities

In this lesson you'll learn to

  • βœ“Student can create an entity with components in Scene Graph and understands the entity/component model they'll master in later zones (arc teaser, free-tier hook).

Student can create an entity with components in Scene Graph and understands the entity/component model they'll master in later zones (arc teaser, free-tier hook).

πŸ“– Reference & full walkthrough: Beyond Devices: First Look at Scene Graph Entities

🧩 Your capstone piece: Not in the shipped capstone β€” the forward-looking hook that sells the paid zones' prefab/component arc


Building Your First Interactive Island with Scene Graph

Have you ever wondered how game developers make trees sway, doors open, or enemies move? They use a special system called Scene Graph. It is like a giant family tree for your game world. In this tutorial, you will learn how to use Scene Graph in Fortnite. You will create an interactive door that opens when a player walks near it. It will be fun and easy. Let's start building!

What You'll Learn

  • What Scene Graph is and why it helps your game.
  • How to use Entities and Components.
  • How to make an object react to a player.
  • How to write simple Verse code for your island.

How It Works

Imagine you are building a LEGO castle. Each brick is a small part. Some bricks are walls. Some are windows. Some are special pieces with hinges. Scene Graph works the same way. It lets you build your game world from small, reusable parts.

In Scene Graph, every object in your game is called an Entity. An entity is like a character or a prop. It can be a tree, a sword, or a door. But an entity needs actions. These actions are called Components. Think of components as skills. A door entity might have a "Move" component. A player entity might have a "Health" component.

When you put components on an entity, you give it behavior. You can tell the door to move when someone touches it. You can tell the player to lose health when they touch a trap. This makes your island feel alive.

Verse is the language we use to talk to these entities. Verse lets you connect the pieces. It says, "When Player touches Door, then Open Door." It is like giving instructions to your LEGO castle.

diagram

The interactive-door flow: a trigger event spawns an async task that opens the door, waits, then closes it.

Let's Build It

We will build a simple security door. It will stay closed. When a player walks close to it, it will slide open. Then it will close again after a few seconds.

Here is the code for your new door. Copy this into a Verse file in your project.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }

# This is our main script for the door
door_script := class(creative_device):

    # We wire the trigger_device in the UEFN editor.
    # Place it around the door so it fires when a player walks close.
    @editable
    DoorTrigger : trigger_device = trigger_device{}

    # We wire the prop_mover_device in the UEFN editor.
    # It holds the door mesh and handles the sliding movement.
    # note: Verse has no free-form MoveObject API; prop_mover_device
    #       is the real UEFN device for animating props at runtime.
    @editable
    DoorMover : prop_mover_device = prop_mover_device{}

    # This function runs when the game starts
    OnBegin<override>()<suspends> : void =
        # Subscribe to the trigger so we know when a player is close
        DoorTrigger.TriggeredEvent.Subscribe(OnDoorTriggered)

    # This function runs when a player gets close
    OnDoorTriggered(Agent : ?agent) : void =
        # Spawn a concurrent task so Sleep does not block other logic
        spawn{ OpenThenCloseDoor() }

    # Moves the door open, waits, then moves it back
    OpenThenCloseDoor()<suspends> : void =
        # Make the door move to its Open waypoint (set in the editor)
        DoorMover.End()

        # Wait for 5 seconds
        Sleep(5.0)

        # Move the door back to its closed position
        DoorMover.Begin()```

Let's look at what each part does.

**`door_script := class(creative_device)`**
This is the name of our instruction book. It tells Verse this code belongs to the door.

**`OnBegin`**
This runs once when the game starts. It connects the trigger device to our function. You must place a **Trigger Device** around the door in the editor and wire it to `DoorTrigger`. This matches the code.

**`OnDoorTriggered`**
This is the magic part. It runs when something touches the trigger. The `Agent` is the thing touching it. Because we use a `trigger_device`, only players fire it automatically. We spawn an async task so the door can sleep without freezing anything else.

**`DoorMover.MoveToEnd`**
This moves the door. The `prop_mover_device` lerps the prop from its start position to its end position. You set both positions in the editor by placing the device's waypoints.

**`Sleep`**
This pauses the code. It lets the player walk through before the door closes.

## Try It Yourself

Now it is your turn to play! Follow these steps to see the code in action.

1.  Open your Fortnite island in the editor.
2.  Place a **Prop-Mover** device and attach your door mesh to it. Set the start position (closed) and the end position (open) using the device's built-in waypoints.
3.  Place a **Trigger Device** around the doorway so it fires when a player walks close. Rename it `DoorTrigger` if you like, but wiring it via `@editable` in the editor is what connects it to the code.
4.  Create a new Verse script file. Paste the code above into it.
5.  Save the script and click "Apply Changes" in UEFN.
6.  Play your island. Walk up to the door. Watch it slide open!

**Challenge:** Can you change the code so the door stays open longer? Try changing the `5.0` inside `Sleep`. What happens if you make it `1.0`?

## Recap

You just used Scene Graph to make a game! You learned that **Entities** are the objects in your world. You learned that **Components** give them actions. You wrote Verse code to make a door move. You can now build more complex islands. Keep experimenting. You are a game creator now!

## References

*   https://dev.epicgames.com/documentation/en-us/fortnite/getting-started-in-scene-graph-in-fortnite
*   https://dev.epicgames.com/documentation/en-us/fortnite/fortnite-documentation
*   https://dev.epicgames.com/documentation/en-us/fortnite/scene-graph-in-unreal-editor-for-fortnite
*   https://dev.epicgames.com/documentation/en-us/fortnite/specifiers-and-attributes-in-verse
*   https://dev.epicgames.com/documentation/en-us/fortnite/concurrency-in-verse
πŸ”’

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/getting-started-in-scene-graph-in-fortnite
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 🦩 South Shores (Free) expedition.

β›΅ Take me there