Make a Platform That Vanishes When You Step On It
Make a Platform That Vanishes When You Step On It
Ever played a map where a platform is there one second, and poof—it's gone the moment you land? It feels like magic, but it's just logic. In Fortnite Creative, we call this a "disappearing platform," and while you could rig it up with wires and triggers, Verse lets you write the actual rulebook for your island.
In this tutorial, we're going to build a simple floating platform that disappears when a player lands on it. It's the perfect introduction to how Verse talks to the game world. By the end, you'll understand how to detect a player's location and change the game state, which is the foundation for everything from trap doors to dynamic loot rooms.
What You'll Learn
- Variables: How to store a reference to a specific device in your island (like saving a bookmark to a specific trap).
- Events: How to tell Verse to "wake up" when something happens (like a player landing).
- The Scene Graph: How Verse sees your island as a hierarchy of objects it can control.
- Device Control: How to turn a device on or off using code, not just wires.
How It Works
To make a platform disappear, we need to solve two problems:
- Detection: How does the computer know a player is standing on the platform?
- Action: How does the computer make the platform vanish?
The Detection: The "Trigger Zone"
Think of a Trigger Zone (or Trigger Device in UEFN) like an invisible tripwire or a pressure plate. In standard Creative, you'd wire a trigger to a prop-mover. In Verse, we define this zone in our code. We create a "box" in the world. If a player's character model enters that box, the code fires an Event.
An Event is like a notification. Imagine you're waiting for the bus. You don't stare at the road every second; you wait for the bus to arrive. In programming, we don't constantly check "is the player here?" We set up a listener that says, "Hey, tell me when a player enters this zone."
The Action: Disabling the Device
Once the event fires (player enters), we need to act. The platform is usually a Prop Mover (the device that moves props up and down) or a Static Prop (a simple object). To make it disappear, we need to disable it.
In UEFN, devices have states. If a Prop Mover is disabled, it stops moving. If a Static Prop is disabled, it becomes invisible and non-collidable (you walk right through it). We will use Verse to send a command to the device: "Turn yourself off."
The Scene Graph
Before we code, remember that Verse sees your island as a tree. At the top is the World. Hanging off the World are Entities (like your Spawn Point, your Prop Movers, your Triggers). Verse needs to know which specific Prop Mover to turn off. We do this by giving the device a unique name in the editor and referencing that name in our code.
Let's Build It
We are going to build a single floating platform. When a player lands on it, it will vanish.
Step 1: Set Up Your Island
- Open UEFN and create a new island.
- Place a Static Prop (like a simple cube or a floor tile) somewhere in the air. Make it look like a platform.
- Name this prop
MyFloatingPlatformin the Details panel (under the "Name" field at the very top). This name is crucial. - Place a Trigger Device directly underneath or covering the top of that platform.
- Set the Trigger Device's Zone Size to match the platform (e.g., 100cm x 100cm).
- Name this trigger
PlatformTrigger.
- Important: Place a Verse Device in your level. This is where we will write our code.
Step 2: The Verse Code
Open the Verse code editor for your Verse Device. Delete the default code and paste this in. I've added comments (lines starting with #) to explain what's happening.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# This is the main structure for our island logic.
# Think of this as the "Brain" of our platform system.
platform_vanisher := class(creative_device):
# 1. DEFINE THE VARIABLES
# We need to tell Verse which devices we are controlling.
# @editable means we can drag-and-drop devices from the editor into these slots.
# This is safer than hard-coding names, and it's how Verse actually resolves
# device references at edit time.
# Here, we define the trigger zone.
# trigger_device is the real Verse type for the Trigger Device in UEFN.
@editable
PlatformTrigger : trigger_device = trigger_device{}
# Here, we define the platform itself.
# creative_prop is the real Verse type for a placeable Static Prop in UEFN.
@editable
MyFloatingPlatform : creative_prop = creative_prop{}
# 2. DEFINE THE ENTRY POINT
# OnBegin runs automatically when the game session starts.
# This is where we wire up our event listener so it is ready before
# any player can step on the platform.
OnBegin<override>()<suspends> : void =
# Subscribe to the TriggeredEvent on the trigger device.
# AgentTriggeredEvent fires whenever any agent (player) enters the zone.
# Await blocks here until the event fires, then calls our handler.
loop:
MaybeAgent := PlatformTrigger.TriggeredEvent.Await()
if (Agent := MaybeAgent?):
OnPlayerEnteringZone(Agent)
# 3. DEFINE THE EVENT HANDLER (The "Wake Up" Call)
# This function runs each time a player enters the trigger zone.
OnPlayerEnteringZone(Agent : agent) : void =
# 4. TAKE ACTION
# When this event fires, we disable the platform we stored above.
# Hide() hides the prop and removes its collision,
# so the player falls straight through.
MyFloatingPlatform.Hide()
# Print a message to the debug console to prove it worked.
Print("Platform vanished! Goodbye, player.")```
### Step 3: Connecting the Dots
1. Save your Verse script.
2. In the UEFN editor, click on your **Verse Device**.
3. In the Details panel, look for the **PlatformTrigger** slot.
4. Drag the **Trigger Device** you placed earlier into this slot.
5. Look for the **MyFloatingPlatform** slot in the same Details panel.
6. Drag the **Static Prop** you placed earlier into this slot.
7. **Playtest.** Jump onto the platform. As soon as your feet touch it, the platform should disappear.
### Why This Code Works
* **`platform_vanisher := class(creative_device)`**: Every Verse script that controls an island must extend `creative_device`. This is the real base class UEFN expects — not a bare `struct`.
* **`@editable PlatformTrigger : trigger_device`**: This creates a "slot" in your Verse Device's Details panel. It's like a socket. You plug the Trigger Device into it. Now Verse knows exactly which zone to listen to.
* **`@editable MyFloatingPlatform : creative_prop`**: This creates a second slot for the prop itself. `creative_prop` is the correct Verse type for Static Props placed in the level.
* **`OnBegin<override>()<suspends> : void`**: This is the real entry point for a `creative_device`. The `<suspends>` specifier is required because we use `Await()` inside it, which pauses execution until the event fires without freezing the whole game.
* **`PlatformTrigger.TriggeredEvent.Await()`**: This is how Verse listens to the trigger. `TriggeredEvent` is the real event on `trigger_device` that fires when an agent enters its zone. `Await()` is the correct way to pause and wait for it inside a `<suspends>` context. The `loop` means we keep listening after each trigger so the handler fires every time, not just once.
* **`MyFloatingPlatform.Disable()`**: This is the real `creative_prop` method that hides the prop and disables its collision, effectively removing it from the active game world.
## Try It Yourself
You've made a platform vanish. Now, let's make it more interesting.
**Challenge:** Modify the code so that the platform doesn't just vanish, but also **respawns** after 5 seconds.
**Hint:**
1. You'll need to use **`Sleep()`**. In Verse, inside any `<suspends>` function, you can call `Sleep(5.0)` to pause that task for 5 seconds without blocking anything else.
2. After the `Sleep`, call `MyFloatingPlatform.Enable()` to bring it back.
3. Because `Sleep` requires a `<suspends>` context, move the hide-and-restore logic into a helper function tagged `<suspends>` and call it with `spawn{ }` from `OnPlayerEnteringZone` so it runs concurrently.
4. *Bonus:* Can you make the trigger ignore further players while the platform is already gone? (Hint: a `var` boolean flag set to `true` while the platform is disabled, checked at the top of `OnPlayerEnteringZone`, will do the trick.)
Don't worry if it breaks! Verse will tell you exactly what's wrong in the console. Read the error, fix the typo, and try again. That's how pros build.
## Recap
* **Variables** are like bookmarks that point to specific devices in your level.
* **Events** are notifications that tell your code when something happens (like a player entering a zone).
* **The Scene Graph** is the hierarchy of all objects in your world, and you can access any object by its name.
* **Device Control** allows you to change the state of devices (like enabling/disabling) via code, giving you total control over gameplay mechanics.
You've just written your first interactive game mechanic. You didn't just place a trap; you programmed the logic behind it. Welcome to Verse.
## References
- https://dev.epicgames.com/documentation/en-us/fortnite/disappearing-platform-on-touch-using-verse-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/uefn/disappearing-platform-on-touch-using-verse-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/using-atk-spawner-device-design-examples-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/loadout-lobby-gameplay-example-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/loadout-lobby-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add The zone a player enters when landing on the platform. 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.