The "Do Not Disturb" Sign: Mastering Disable in Verse
Tutorial beginner compiles

The "Do Not Disturb" Sign: Mastering Disable in Verse

Updated beginner Code verified

The "Do Not Disturb" Sign: Mastering Disable in Verse

You know that feeling when you’re trying to sit in a chair to heal up, but your teammate keeps kicking you out because they’re spamming the interact button? It’s annoying. Now imagine you’re the island creator. You don’t want to kick them; you want to turn the chair into a useless piece of furniture so they can’t interact with it at all. That’s exactly what Disable does. It’s the digital equivalent of putting a "Out of Order" sign on a toilet or locking a door from the outside.

In this tutorial, we’re going to build a simple "Trap Door" that starts open, lets players walk through, and then slams shut and locks itself so no one can come back the other way. We’ll learn how to use the Disable command to take devices offline, effectively removing them from the game’s logic until you decide to wake them up again.

What You'll Learn

  • What Disable is: How to completely shut down a device’s functionality (interactions, events, movement) so it becomes inert.
  • The using statement: How to tell Verse you want to talk to Fortnite devices.
  • Device References: How to point your code at a specific object in your island (like a specific Chair or Hiding Prop).
  • State Management: How to change a device from "active" to "broken/offline" using code.

How It Works

Think of every device in UEFN (like a Chair, a Hiding Prop, or a Trigger Volume) as a person standing in a room.

Normally, this person is listening. If you walk into their trigger, they hear you. If you press 'E' on a chair, they let you sit.

When you call Disable on a device, it’s like telling that person to put on noise-canceling headphones and ignore everyone. They don’t disappear from the room (the 3D model is still there), but they stop responding to anything. They don’t trigger events. They don’t let you interact. If it’s a chair, anyone sitting in it gets ejected (because the chair just... stopped being a chair).

In Verse, we don’t just say "disable stuff." We have to be specific. We have to say, "Hey, Verse, take this specific Chair at this specific location and disable it."

To do this, we need two things:

  1. A Reference: A way to point to the specific device in your island.
  2. The Command: The Disable function.

It’s like having a remote control. You need to point the remote at the TV (the reference) before you can press the power button (the disable command).

Let's Build It

We are going to build a One-Way Trap Door.

  1. The Setup: You’ll need a Hiding Prop Device (this will be our door) and a Player Start or just some open floor.
  2. The Logic: When a player steps on a trigger, the door closes (if it has movement) or simply becomes "disabled" so no one can interact with it again. For this example, let's use a Hiding Prop that acts as a secret wall. We want it to be interactive/open at the start, but once a player touches a "Pressure Plate" (a simple Trigger Volume), the wall disables itself so it can’t be toggled anymore.

Note: In Verse, Disable works on many devices. For this tutorial, we will use a generic device reference pattern that applies to HidingPropDevice or ChairDevice. Since Hiding Props are great for "secret" mechanics, we'll focus on that.

Here is the Verse code. Copy this into a new Verse file in UEFN.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# This is our main script. Think of it as the brain of the trap.
TrapDoorBrain := class(creative_device):
    # We need to tell the script which devices we are controlling.
    # 'MyDoor' is the name we give to the Hiding Prop in the code.
    # 'PressurePlate' is the name we give to the Trigger Volume.
    @editable
    MyDoor : hiding_prop_device = hiding_prop_device{}
    @editable
    PressurePlate : trigger_device = trigger_device{}

    OnBegin<override>()<suspends>: void =
        # This runs when the game starts.
        # We set up the 'listener' for when someone steps on the plate.
        # 'TriggeredEvent' is an event that fires when an agent (player) activates the trigger.
        PressurePlate.TriggeredEvent.Subscribe(OnTriggered)

    OnTriggered(Agent : ?agent) : void =
        # When someone enters the plate...
        # 1. We disable the door.
        # This makes the door stop responding to interactions.
        # It effectively 'locks' the state of the door.
        MyDoor.Disable()

        # Optional: You could also play a sound or spawn an explosion here!
        Print("Door is now disabled! No more interacting.")```

### Walkthrough: What Just Happened?

1.  **`using { /Fortnite.com/Devices }`**: This is the most important line. Its like walking into the Fortnite store and saying, "I want to buy devices." Without this, Verse doesnt know what a `HidingPropDevice` or `TriggerVolume` is. Its just random words. This line gives Verse the dictionary of Fortnite devices.
2.  **`MyDoor := class(HidingPropDevice)`**: This looks weird, but its simple. We are creating a "slot" in our code named `MyDoor` that is designed to hold a Hiding Prop. Later, in UEFN, you will drag and drop your actual Hiding Prop into this slot.
3.  **`PressurePlate := class(TriggerVolume)`**: Same thing. We made a slot for our trigger.
4.  **`OnBegin`**: This is a function that runs automatically when the island starts. Its like the "Start Game" button.
5.  **`PressurePlate.OnEnter.Subscribe(...)`**: This is the magic. We are telling Verse: "Watch the PressurePlate. The moment an agent enters it, run the code inside the parentheses."
6.  **`MyDoor.Disable()`**: This is the star of the show. We are calling the `Disable` function on our `MyDoor` reference.
    *   **Result:** The Hiding Prop stops working. It wont toggle. It wont trigger events. Its dead in the water.

## Try It Yourself

**The Challenge:**
Right now, our door just disables. But what if you want a **Revenge Chair**?

Create a new script where:
1.  You have a **Chair Device**.
2.  You have a **Button Device** (or another Trigger).
3.  When a player presses the button, the Chair disables itself.
4.  **Bonus:** If a player is *already sitting* in the chair when it disables, what happens? (Hint: Check the documentation or test it! The docs say agents are ejected.)

**Hint:**
Youll need to change `HidingPropDevice` to `ChairDevice` in your class definition. And dont forget to drag your actual Chair into the `MyDoor` slot in the UEFN details panel!

## Recap

*   **`Disable`** is a command that turns a device off. It stops interactions, events, and movement.
*   You must **reference** a specific device in your Verse script to disable it. You cant just say "disable all chairs"; you have to say "disable *this* chair."
*   The **`using` statement** is required to access device functions like `Disable`.
*   Disabling a chair ejects anyone sitting in itperfect for pranking your friends or creating sudden difficulty spikes.

## References

- https://dev.epicgames.com/documentation/en-us/uefn/verse-api/fortnitedotcom/devices/chair_device/disable
- https://dev.epicgames.com/documentation/fortnite/verse-api/fortnitedotcom/devices/hiding_prop_device/disable
- https://dev.epicgames.com/documentation/fortnite/verse-api/fortnitedotcom/devices/chair_device/disable
- https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/fortnitedotcom/devices/hiding_prop_device/disable
- https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/fortnitedotcom/devices/chair_device/disable

Verse source files

Turn this into a guided course

Add disable 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