Create Your First Verse Device Script
In this lesson you'll learn to
- Create a new Verse device file in UEFN using Verse Explorer.
- Write a Verse device script that uses a variable, a function, and an if/else check.
- Compile and drag your custom device into your Fortnite island level.
- Playtest your island and see your Verse code run live in the game.
🎮 What Is a Verse Device?
Imagine a remote control car. The car itself sits on the floor of your room — that's like your Fortnite island. The circuit board inside the car is the device. The instructions you program into it tell the car what to do: go forward, turn left, honk!
A Verse device works the same way. It's a little invisible gadget you place on your island. Your Verse code is the instructions inside it. When the game starts, the device follows your instructions and makes things happen!
🛠️ Step 1 — Create a New Verse Device File
First, you need to make the file where you'll write your code. Think of this like getting a blank piece of paper before you draw.
Here's how:
- Open your project in UEFN (Unreal Editor for Fortnite).
- In the top menu bar, click Verse, then click Verse Explorer. This is like a file cabinet for all your Verse scripts.
- In Verse Explorer, right-click your project name. Choose Add new Verse file to project.
- A window pops up. Click Verse Device as your template. A template is a starter design — like a cookie cutter that already has the basic shape.
- In the Device Name box, type
score_tracker_device. Then click Create. - Double-click your new file in Verse Explorer. It opens in Visual Studio Code — that's your coding notebook!
🧱 Step 2 — Understand the Starter Code
When UEFN creates your device file, it gives you some starter code. Here's what the important parts mean:
using { /Script/FortniteGame }— This line is like saying "borrow tools from Fortnite's toolbox."creative_device— This is the special Verse type that makes your script become a real device on your island.OnBegin— This is a built-in function. It runs your code the moment the game starts. Think of it like the starting pistol at a race — bang, your code goes!
🔢 Step 3 — Variables: Boxes That Hold Information
A variable is like a labeled box. You put something inside, and you can change what's in it later.
For example:
- A box labeled
PlayerScoremight hold the number0at the start. - When a player does something cool, you change it to
1, then2, and so on!
In Verse, you create a variable like this:
var Score : int = 0
varmeans "this box can change later."Scoreis the label on the box.intmeans the box holds a whole number (like 0, 1, 5 — no fractions).= 0is the starting value — the number already inside the box.
⚙️ Step 4 — Functions: Named Sets of Instructions
A function is like a recipe. You write it once, give it a name, and you can use it over and over.
Imagine a recipe called "Make Lemonade." Every time you follow it, you get lemonade! A function called AddPoint could say: every time you run it, add 1 to the score.
🔀 Step 5 — Control Flow: Making Decisions
Control flow means your code can make choices. Think of it like a Choose-Your-Own-Adventure book.
If something is true, do this. Else (otherwise), do that.
if (Score >= 3):
Print("You win! 🎉")
else:
Print("Keep going!")
ifasks a question: Is Score 3 or more?- If YES, it prints "You win!"
- If NO, it prints "Keep going!"
📦 Step 6 — Compile and Place Your Device
Compiling means turning your human-readable code into something UEFN can actually run. It's like a translator turning English into Robot Language.
- In the top menu, click Verse > Build Verse Code.
- Wait a moment. Your device now appears in the Content Browser under CreativeDevices.
- Drag and drop your device onto your island — just like placing any other object!
- Click Launch Session in the toolbar to playtest. Hit Start Game and watch your code run! 🚀
Keep going — free
You've read the intro. The rest of this lesson — the worked example, the hands-on exercise, the quiz, and the recap — is free for members. Sign in to continue and track your progress.
New here? The whole Verse Basics track is free with a free account — sign in to start.
Sources
/docs/documentation/en-us/uefn/create-your-own-device-in-verse /docs/documentation/en-us/fortnite/create-your-own-device-in-verse /docs/documentation/en-us/fortnite/create-your-own-device-using-verse-in-unreal-editor-for-fortnite© Biloxi Studios Inc. — original Verse Island content.
Turn this into a guided course
Add Create Your First Verse Device Script 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.
🧭 The Keeper's log
Quest complete? Chart your next heading from the Verse Basics expedition.