Spawn & Crush: Building an Infinite SUV Gauntlet with 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.
Spawn & Crush: Building an Infinite SUV Gauntlet with Verse
So, you've placed your SUV Spawner. It's sitting there, looking smug, waiting for a player to get in and drive off. But what happens when they crash? Does it vanish? Do you have to wait for a 10-minute round reset? Or do you just have to manually run over and drag another one out of the editor?
Boring.
In this tutorial, we're going to ditch the manual labor. We're going to write a tiny bit of Verse (Epic's programming language for Fortnite islands) to create an Infinite SUV Gauntlet. The goal is simple: When a player exits or destroys the SUV, it instantly respawns right back where it started. No loading screens, no waiting, just endless vehicular chaos.
We'll also touch on how to manage multiple vehicles without your Event Browser turning into a soup of "SUV Spawner 42" labels.
What You'll Learn
- Variables: How to store the location of a specific SUV so you can find it again later (think of it as a "last known position" tracker).
- Events: How to listen for specific moments, like a vehicle being destroyed or a player getting out.
- Scene Graph Basics: Understanding how devices relate to the world and how Verse "sees" them.
- Respawning Logic: The code equivalent of "press F5 to reload," but automated.
How It Works
In standard Creative, if you want a vehicle to respawn, you usually rely on the device's built-in "Respawn Time" setting. But that has limits. What if you want the vehicle to respawn instantly? What if you want to track how many times a player has crashed it? Or what if you want to change the vehicle's color every time it respawns?
That's where Verse comes in.
Think of a Verse Script as a custom rulebook for a specific device. You attach this rulebook to your SUV Spawner. The rulebook says: "Hey, every time the vehicle disappears (because it exploded or was despawned), immediately spawn a new one at the exact same spot."
The Scene Graph: Where Things Live
Before we write code, we need to understand Scene Graph concepts. In Unreal Engine (and Verse), everything in your island is part of a hierarchy.
- Entity: Think of this as a "Thing" in the world. An SUV Spawner is an Entity. A player is an Entity. A tree is an Entity.
- Component: These are the features attached to an Entity. The SUV Spawner has a "Spawn Function" component. The player has a "Movement" component.
- Reference: In Verse, we don't just say "the SUV." We need to point to the specific SUV Spawner device we're coding for. We do this by creating a Variable that holds a reference to that device.
The Logic Flow
- Setup: We tell the script which SUV Spawner we are controlling.
- Listen: We subscribe to the
VehicleDestroyedEventon the spawner device. - Act: When that event fires, we trigger the
Activatefunction on our specific SUV Spawner. - Loop: The vehicle is gone. The script detects it. The script spawns a new one. Repeat.
Let's Build It
We are going to create a script called InfiniteSUV.verse. This script will be attached to an SUV Spawner device.
Step 1: The Setup
- Place an SUV Spawner device on your island.
- Open the Verse Editor (click the "Verse" icon in the Creative toolbar).
- Click "New File" and name it
InfiniteSUV. - Delete the default template code. We're starting fresh.
Step 2: The Code
Copy and paste this code into your InfiniteSUV.verse file. Don't worry, I'll break it down line by line.
# InfiniteSUV.verse
# A simple script to respawn an SUV instantly when it's destroyed.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# 1. DEFINE THE SCRIPT
# This is the "container" for our logic.
# We name it "infinite_suv_script".
# creative_device is the real base class for all UEFN device scripts.
infinite_suv_script := class(creative_device):
# 2. DEFINE THE DEVICE REFERENCE
# This variable holds the link to the SUV Spawner device.
# '@editable' exposes this field in the UEFN details panel so you can
# drag-and-drop the actual SUV Spawner device onto it in the editor.
# 'suv_spawner_device' is the real Verse type for this device.
@editable
SuvSpawner : suv_spawner_device = suv_spawner_device{}
# 3. INITIALIZATION — OnBegin runs once when the island session starts.
# We use this to subscribe to the events we care about.
OnBegin<override>()<suspends> : void =
# 4. SUBSCRIBE TO THE VEHICLE DESTROYED EVENT
# 'VehicleDestroyedEvent' is the real listenable on suv_spawner_device.
# '.Subscribe()' registers our handler function to be called each time
# the event fires.
SuvSpawner.VehicleDestroyedEvent.Subscribe(HandleVehicleDestroyed)
# 5. THE HANDLER FUNCTION (THE BRAIN)
# This function is called automatically whenever VehicleDestroyedEvent fires.
# It receives an 'agent' representing whoever dealt the killing blow
# (or 'false' if there was none). We use '?' to make the parameter optional.
HandleVehicleDestroyed(Instigator : ?agent) : void =
# Print a message to the output log (great for debugging).
Print("SUV destroyed! Respawning now...")
# TRIGGER THE SPAWN
# 'Activate()' on suv_spawner_device tells the spawner to produce
# a fresh vehicle at its placed location immediately.
SuvSpawner.Activate()
Wait, isn't that too simple?
Actually, yes. And that's the point. The suv_spawner_device in UEFN already has a built-in Activate() function. We don't need to reinvent the wheel. We just need to trigger it at the right time.
However, there's a catch. The VehicleDestroyedEvent only fires when the vehicle is actually destroyed. What if the player just drives away and parks it somewhere? For a true "infinite" loop, we often need to handle the Player Exit event as well.
Let's upgrade the code to be more robust.
Step 3: The "Robust" Version (Handling Player Exit)
Players don't always destroy SUVs. Sometimes they just get out and walk away. We need to catch that too.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
infinite_suv_script := class(creative_device):
# Reference to the SUV Spawner — assign it in the UEFN details panel.
@editable
SuvSpawner : suv_spawner_device = suv_spawner_device{}
# OnBegin: subscribe to both events we care about.
OnBegin<override>()<suspends> : void =
# 1. Vehicle was destroyed (exploded, fell off map, etc.)
SuvSpawner.VehicleDestroyedEvent.Subscribe(HandleVehicleDestroyed)
# 2. A player exited the vehicle under their own power.
# 'AgentExitedVehicleEvent' is the real listenable on suv_spawner_device.
SuvSpawner.AgentExitedVehicleEvent.Subscribe(HandlePlayerExited)
# Handler: vehicle destroyed
HandleVehicleDestroyed(Instigator : ?agent) : void =
Print("Boom! Respawning SUV.")
SuvSpawner.Activate()
# Handler: player voluntarily exited
# The event delivers the agent (player) who stepped out.
HandlePlayerExited(ExitingAgent : agent) : void =
# If the player just gets out, respawn the vehicle immediately
# so the next player (or the same one) always finds a fresh SUV.
Print("Player bailed! Respawning SUV.")
SuvSpawner.Activate()
Important Note on UEFN Implementation:
In the actual UEFN editor, you don't usually write the VehicleDestroyedEvent logic from scratch because the suv_spawner_device already has a "Respawn Time" property. However, Verse allows you to override or extend this behavior.
For a true beginner, the most powerful use of Verse with SUV Spawners is Dynamic Spawning. Instead of having one spawner that respawns, you can have a Verse script that spawns an SUV only when a player enters a trigger zone.
Let's pivot to a more interesting example: The Trap Door SUV.
Revised Example: The Trap Door SUV
Imagine a bridge. When a player steps on the bridge, an SUV spawns on the other side to block them. If they destroy it, it respawns after 5 seconds.
Why this is better for learning:
- Variables: You see
SuvSpawnerandTriggerZoneas distinct entities. - Events: You see
TriggeredEventas the "trigger" for the action. - Scene Graph: You understand that the
trigger_deviceandsuv_spawner_deviceare separate devices in the world, but the script connects them.
Try It Yourself
Challenge: Create a "Revenge SUV" system.
- Place an SUV Spawner.
- Write a Verse script that listens for the
VehicleDestroyedEventevent. - When the vehicle is destroyed, instead of spawning an SUV, spawn a Tank (using a Tank Spawner device) for 10 seconds.
- After 10 seconds, spawn the SUV again.
Hint: You'll need to use a Sleep call in Verse to pause the script for 10 seconds. You'll also need to reference two different spawner devices in your script.
Don't know how to wait? Look up Sleep in the Verse documentation. It takes a float number of seconds — Sleep(10.0) pauses the current async context for ten seconds. It's like setting a storm timer in Creative, but in code.
Recap
- Verse lets you automate device interactions that standard Creative settings can't handle.
- Variables (marked
@editable) store references to devices (like the SUV Spawner) so your code knows which device to control. - Events (like
VehicleDestroyedEvent) are the triggers that tell your code "Hey, something happened!" - Scene Graph concepts help you understand that every device is an Entity with Components, and Verse scripts act as the glue between them.
You've just taken your first step into programming Fortnite islands. You didn't just place a device; you made it think. Now go make some chaos.
References
- https://dev.epicgames.com/documentation/en-us/fortnite/using-suv-spawner-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-suv-spawner-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/vehicle-mod-box-spawner-device-design-examples-in-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/using-vehicle-mod-box-spawner-devices-in-fortnite-creative
Get the complete code — free
You've read the full walkthrough. The complete, copy-paste-ready Verse solution is free for members — sign in to unlock it.
Free with your BrainDead.TV / BrainDeadGuild Discord account. The walkthrough above is always free.
Verse source files
- 01-device.verse · device
- 02-device.verse · device
- 03-device.verse · device
Turn this into a guided course
Add using-suv-spawner-devices-in-fortnite-creative 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.