The Ghost in the Machine: How Devices Power Your Island
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 Ghost in the Machine: How Devices Power Your Island
You’ve placed the walls, you’ve painted the floor, and you’ve dropped a few trees for ambiance. It looks pretty. It’s also completely dead. No one is shooting at you, nothing is exploding, and the only sound is the wind blowing through your empty arena.
That’s because you haven’t added Devices.
If props are the furniture of your island, Devices are the electricity, the plumbing, and the chaotic gremlin living in the walls. They are the interactive guts of Fortnite Creative and UEFN. Without them, you have a screenshot. With them, you have a game.
In this tutorial, we’re going to stop building museums and start building machines. We’ll take a basic "Box Fight" setup and wire up a Revenge Trap. When a player steps on a button, they get a weapon, but if they step on the wrong button, they get launched into the sky. It’s simple, it’s satisfying, and it’s the first step toward mastering the logic of Verse.
What You'll Learn
- What a Device is: Understanding the difference between static props and interactive game mechanics.
- The Input/Output Loop: How devices talk to each other (Events, Functions, and Receivers).
- Scene Graph Basics: Why where you place a device matters more than you think.
- Verse Logic: Writing a tiny script to make a button grant loot or cause chaos.
How It Works
The Device vs. The Prop
Imagine you’re playing Fortnite. You see a rock. You shoot it. It breaks. That rock is a Prop. It’s part of the scenery. It doesn’t care if you’re alive or dead, it doesn’t have a health bar, and it doesn’t trigger anything.
Now imagine you see a Trigger Volume (a box in the sky). You walk into it, and suddenly a turret spawns. That Trigger is a Device. It’s an invisible (or visible) object that has rules. It knows when you enter it, it knows when you leave, and it knows how to react.
In UEFN, devices are categorized by what they do:
- Gameplay Devices: Triggers, Buttons, Item Granters.
- Visual Devices: Lights, Particle Emitters.
- System Devices: Timers, Scoreboards.
The Language of Devices: Events and Functions
Devices speak in a simple language of cause and effect. Think of it like the storm or a respawn pad.
- The Event (The "When"): Something happens. A player presses a button. The storm moves in. A player gets eliminated. This is an Event. It’s a notification sent out into the world.
- The Function (The "What"): Something reacts. The trap door opens. You take damage. You get a new gun. This is a Function. It’s a specific action a device performs.
In Verse (Epic’s programming language), we connect these. We say: "When [Event A] happens, do [Function B]."
The Scene Graph: The Family Tree
This is the part that trips up beginners. Every device in your game lives in a Hierarchy (or Scene Graph). Imagine a family tree.
- The World is the grandparent.
- A Zone (like a room) is the parent.
- A Trigger inside that room is the child.
Why does this matter? Because if you parent a Trigger to a moving Prop, the Trigger moves with the Prop. If you parent a Light to a Player, the light follows them like a loyal pet. Understanding hierarchy lets you build complex systems where devices move, rotate, and interact as a single unit.
Let's Build It
We are building a "Chaos Button" island.
- Button A: Grants you a shotgun (The Reward).
- Button B: Launches you into the stratosphere (The Punishment).
We will use Verse to make this happen. Don’t panic. The code is short, and it’s just English with punctuation.
Step 1: The Setup
- Open UEFN.
- Create a new island (or use an existing one).
- Place two Buttons (from the Devices menu) on the floor. Name them
Reward_ButtonandPunishment_Button. - Place an Item Granter near Button A. Name it
Loot_Grant. - Place a Prop Mover near Button B. Set its "Start at Game Start" to
Trueand "Visible During Game" toFalse(it’s a hidden trap).
Step 2: The Verse Script
In the Content Browser, create a new Verse File. Let’s call it ChaosLogic.vr.
Here is the code. Copy it, paste it, and then we’ll break down what’s happening.
# This script connects buttons to actions.
# Think of this as the brain of your island.
using { /Fortnite.com/Devices }
using { /Verse.org/Sim }
# We create a "Class" which is like a blueprint for our logic.
# It’s like a custom game mode.
ChaosLogic := class(VerseSimContext):
# This is the "Constructor". It runs once when the game starts.
# It’s like the Battle Bus taking off—you set up the rules before anyone jumps.
OnBegin<override>()<static>:
# 1. Find our devices by name.
# We are looking for the buttons and the item granter we placed in the editor.
reward_button := FindDevice[Button](`Reward_Button`)
punishment_button := FindDevice[Button](`Punishment_Button`)
loot_granter := FindDevice[ItemGranter](`Loot_Grant`)
# 2. Connect the Reward Button.
# When this button is pressed...
reward_button.PressedEvent.Subscribe(
# ...do this function:
func():
# Grant the player a Pump Shotgun.
# We use the "Grant" function on the Item Granter.
# We assume the granter is set up to give a shotgun in its options.
loot_granter.Grant()
# Optional: Print a message to the console for debugging.
Print("You got the shotgun!")
)
# 3. Connect the Punishment Button.
# When this button is pressed...
punishment_button.PressedEvent.Subscribe(
# ...launch the player.
func():
# This is a bit trickier. We need to find the player who pressed it.
# For simplicity, we'll assume we trigger a Prop Mover that pushes them.
# In a real scenario, you'd link this to a Prop Mover's "Activate" function.
# Here, we just print a warning.
Print("Oops! You triggered the trap!")
# To actually launch them, you would typically:
# 1. Place a Prop Mover set to "Move Up" with high force.
# 2. Link the Button's PressedEvent to the Prop Mover's ActivateEvent.
# Verse allows you to do this directly:
# trap_mover.Activate()
Walkthrough: What Just Happened?
using { ... }: These are Imports. Think of them as opening your loot bag. You need to bring in the tools (Devices and Verse basics) before you can use them.class(VerseSimContext): This defines our Game Logic. It’s like creating a new Game Mode in Creative. Everything inside this class belongs to our specific island’s rules.OnBegin: This is a special Function that runs exactly once when the round starts. It’s the "Initialize" phase. If you don’t put your code here, the devices won’t know who they are.FindDevice: This is how we grab our props. We’re telling Verse: "Go find the device namedReward_Buttonin the world." If the name doesn’t match exactly, it fails. Pro tip: Names are case-sensitive.Buttonis notbutton..Subscribe: This is the magic glue. We are saying: "Hey,reward_button, whenever you get pressed, run the code inside this block." This is the Event triggering a Function.
The "No-Code" Alternative
If Verse feels like too much right now, you can do this in the Device Panel (the wire-up view):
- Click the
Reward_Button. - Go to the Events tab.
- Find
PressedEvent. - Drag a line to the
Loot_Grantdevice. - Select
Grantas the function.
Verse is just a more powerful, programmable version of this wire-up system. It lets you do things like "If the player has less than 50 HP, don’t give them the gun." You can’t do that with simple wires.
Try It Yourself
Challenge: Make the "Punishment Button" actually launch the player.
Hint:
- Place a Prop Mover device.
- In the Prop Mover’s options, set Movement Type to "Move Up" and Distance to 500 units.
- Set Start at Game Start to
False(we don’t want it moving until triggered). - In your Verse code, find the Prop Mover using
FindDevice[PropMover]. - Subscribe to the Button’s
PressedEventand call the Prop Mover’sActivate()function.
Bonus: Add a Timer so the button resets after 5 seconds. Use TimerDevice and its Start() function.
Recap
- Devices are the interactive engines of your island. Props are scenery; Devices are gameplay.
- Events are notifications ("I was pressed!"). Functions are actions ("Grant item!").
- Verse connects Events to Functions. It’s the logic layer that makes your island feel alive.
- Hierarchy matters. Know where your devices live in the scene graph so they move and behave correctly.
You’ve just written your first logic script. You’re no longer just placing rocks; you’re building systems. Now go make something that makes your friends scream (in a good way).
References
- https://dev.epicgames.com/documentation/en-us/fortnite/getting-started-with-devices-in-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/creating-gameplay-with-devices-in-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/box-fight-3-add-devices-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/using-progress-based-mesh-devices-in-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/building-your-first-island-in-fortnite-creative
Verse source files
- 01-standalone.verse · standalone
Turn this into a guided course
Add getting-started-with-devices-in-fortnite 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.