The "It's Alive!" Button: Mastering Enable in Verse
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 "It's Alive!" Button: Mastering Enable in Verse
Ever built a trap, placed a switch, and watched it sit there doing absolutely nothing because it was technically "off"? Or maybe you spawned a chair that players couldn’t sit in because it was stuck in limbo? That’s not bad game design; that’s a device that hasn’t been told to wake up. In Verse, nothing happens until you flip the switch. Literally.
Today, we’re going to learn how to use the Enable function. Think of this as the master power switch for your island’s logic. By the end of this tutorial, you’ll build a "Secret Boss Room" that stays locked and invisible until a specific condition is met, then boom—the doors open, the lights turn on, and the boss spawns. No more dead devices.
What You'll Learn
- What "Enable" means: Why devices are shy by default and how to give them a voice.
- The Scene Graph basics: Understanding that every object in your game is an "Entity" with a "Component" (the device).
- How to write the code: Using Verse to call
Enableon aMap ControllerorChair Device. - Real-world application: Building a "Wait for Player" trap or interactive prop.
How It Works
The "Shy Device" Problem
In Fortnite Creative, you might place a Prop Mover or a Trap and expect it to work immediately. In Verse, devices are like shy introverts at a party. They are physically there (in the Scene Graph), but they are socially inactive. They won’t listen to triggers, won’t move, won’t spawn items, and won’t let you sit on them unless you explicitly tell them to participate.
This is where Enable comes in.
Enable vs. Activate
Don’t confuse these two. It’s like the difference between "turning on the TV" and "pressing play on Netflix."
- Enable: This is the power button. It turns the device’s internal logic on. Once enabled, the device is ready to receive signals (events) or be triggered manually.
- Activate: This is the signal. You press the button on the remote (trigger), and the TV reacts.
If a device is Disabled, it’s like a TV with the cord unplugged. Pressing the remote does nothing. If it’s Enabled, the TV is on, waiting for you to change the channel.
The Scene Graph: Where Devices Live
Before we code, you need to know where these devices live. In Unreal Engine 6 (and UE5), the game world is a hierarchy called the Scene Graph.
- Entity: Any object in your game (a player, a tree, a chair, a trigger zone). Think of an Entity as a "Person" in your game.
- Component: The specific job or tool that Person is holding. A
Map Controller Deviceis a Component attached to an Entity.
When you write Verse code, you are usually reaching into the Scene Graph, finding a specific Entity, grabbing its Device Component, and saying, "Hey, you’re on duty now. Start working."
Let's Build It
We are going to build a "Revenge Trap Door."
- The Setup: A trap door (Prop Mover) that is currently disabled.
- The Trigger: A zone that detects when an enemy player walks on it.
- The Code: When the enemy steps on the zone, Verse finds the trap door device and calls
Enableon it. - The Result: The trap door activates (because it’s now enabled and connected to a timer), dropping the enemy into the pit.
Note: For this tutorial, we will focus purely on the Verse logic for Enable. You will need to have a Prop Mover (set to "Open/Close") and a Trigger Volume set up in your island editor first.
The Verse Script
Here is the complete script. Copy this into a Verse file in your project.
using { /Fortnite.com/Devices }
using { /Fortnite.com }
# This is our main "Brain" entity.
# Think of it as the game director.
RevengeTrap := class(creative_actor):
# We need to link to our devices in the editor.
# These are "Properties" – slots where you plug in your devices.
TrapDoorDevice: prop_mover_device = prop_mover_device{}
EnemyTrigger: trigger_volume_device = trigger_volume_device{}
# This runs once when the game starts.
OnBegin<override>()<sided>:void=
# STEP 1: The "Wake Up" Call
# We call Enable() on the Trap Door.
# Why? Because by default, devices are disabled.
# If we don't do this, the trap door is a ghost.
# It won't move, even if we tell it to later.
TrapDoorDevice.Enable()
# Optional: You can also Enable the trigger if you want
# it to start listening immediately.
EnemyTrigger.Enable()
# This runs every time someone enters the trigger zone.
# 'other' is the player who stepped on the zone.
OnActorBeginOverlap<override>(other: actor):void=
# Check if the person who stepped on it is an Enemy
if other.GetTeam() != GetTeam():
# STEP 2: The Attack
# Now that the trap door is Enabled, we can Activate it.
# Activate tells the device to perform its action (Open/Close).
TrapDoorDevice.Activate()
# Optional: Disable it after 5 seconds so it resets?
# That's a challenge for later!
Walkthrough: What Just Happened?
TrapDoorDevice.Enable(): This is the star of the show. Before this line runs, theprop_mover_deviceis inert. It exists in the Scene Graph, but it’s "off." CallingEnable()flips the internal switch. Now, the device is listening for commands.OnBegin: This is the "Game Start" event. We putEnable()here so the trap is ready to go from the moment the match starts. If you put it inOnActorBeginOverlap, the trap would only enable after someone stepped on the trigger, which might be too late!TrapDoorDevice.Activate(): Now that the device is Enabled, we can tell it to do something.Activateis the command to move the prop.
Why not just use the Device Editor?
You could wire a Trigger Volume to a Prop Mover using the visual graph in UEFN. But using Verse Enable gives you conditional control. You can enable a device only if a player has a certain item, only after a certain time, or only for specific teams. The visual graph is great for simple chains; Verse is for complex logic.
Try It Yourself
Challenge: The "Late Night" Chair
You’ve placed a fancy Chair Device in your island. But you don’t want players to sit in it until they’ve collected 5 coins.
- Place a
Chair Deviceand name itVIPChair. - Create a Verse script that:
- References
VIPChair. - In
OnBegin, disables the chair (hint: there is aDisable()function, just likeEnable()). - When a player picks up a coin (use
OnCollectiblePickedUpor a simple counter), check if they have 5 coins. - If they have 5 coins, call
VIPChair.Enable().
- References
Hint: If you forget to Enable the chair, players will walk right through it or see it but can’t interact. Remember: No Enable, No Interaction.
Recap
- Enable is the master power switch for Verse devices.
- Devices are Disabled by default. They won’t respond to triggers or events until you call
Enable(). - Use
EnableinOnBeginto get things ready, or conditionally in other events to unlock features. - Remember the Scene Graph: You are reaching into the world, finding a device component, and turning it on.
Now go make your islands alive. Or at least, make your devices stop being shy.
References
- https://dev.epicgames.com/documentation/fortnite/verse-api/fortnitedotcom/devices/map_controller_device/enable
- https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/fortnitedotcom/devices/map_controller_device/enable
- https://dev.epicgames.com/documentation/en-us/uefn/verse-api/fortnitedotcom/devices/chair_device/enable
- https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/fortnitedotcom/devices/chair_device/enable
- https://dev.epicgames.com/documentation/fortnite/verse-api/fortnitedotcom/devices/chair_device/enable
Verse source files
- 01-standalone.verse · standalone
Turn this into a guided course
Add enable 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.