Spawn Wars: How to Drop Vehicles Like a Pro in UEFN
Tutorial beginner

Spawn Wars: How to Drop Vehicles Like a Pro in UEFN

Updated beginner

Spawn Wars: How to Drop Vehicles Like a Pro in UEFN

So you’ve got your racetrack laid out, but right now, your island is just a fancy empty parking lot. No cars. No chaos. Just you, your mouse, and a lot of disappointment. It’s time to fix that.

In this tutorial, we’re going to stop building static scenery and start building spawners. We’ll teach you how to use Verse to control exactly when and where vehicles appear, turning your race into a dynamic event rather than a boring drive around an empty circle. By the end, you’ll have a system that spawns cars on command, just like the Battle Bus drops you onto the island—but for four-wheeled death machines.

What You'll Learn

  • The Scene Graph: Understanding the difference between the "blueprint" of a car and the actual car sitting on your track.
  • Variables: How to store data (like "is the car spawned?") so your game knows what’s happening.
  • Functions: Creating a reusable "Spawn Car" command so you don’t have to rewrite code for every single vehicle.
  • Events: Triggering the spawn when a player hits a button or crosses a line.

How It Works

To understand how we spawn cars, you first need to understand the Scene Graph. Think of the Scene Graph as your island’s family tree or a hierarchy of folders.

In Fortnite Creative, when you place a Vehicle Spawner device, you aren’t placing the car itself. You are placing a template or a blueprint for the car. This is a crucial distinction. The Spawner is the "Parent," and the actual Car that appears on the track is the "Child" (or Entity).

  • The Spawner (Parent): This is like the Battle Bus. It doesn’t move; it just exists in the world to say, "Hey, when I say go, drop a guy here."
  • The Car (Child/Entity): This is the actual vehicle. It has health, speed, and physics. It exists because the Spawner told it to.

If you want to control the car (like making it explode or turn invisible), you can’t just click on it in the editor like a normal prop. You have to find it in the code using the Spawner.

We’ll use a Variable to keep track of our cars. A variable is just a labeled box where you store information. In this case, our box is labeled MyCar, and inside it, we’ll store the reference to the actual vehicle entity. If the box is empty, no car is there. If it has a car in it, we can interact with that car.

Finally, we’ll use a Function. Think of a Function like a custom item in your loadout. You define what it does once (e.g., "Spawn a Pickup Truck"), and then you can use that item as many times as you want. We don’t want to write the code to spawn a car every single time; we just want to write it once and press a button.

Let's Build It

We are going to build a simple system: A Trigger that, when you run over it, spawns a Pickup Truck at a specific Spawner location.

The Setup (Editor Side)

Before writing code, let’s get our devices ready in the Unreal Editor for Fortnite (UEFN).

  1. Place a Pickup Truck Spawner: Drag one from the devices menu onto your track. Let’s call this Spawner_01.
  2. Configure the Spawner: Click on it. In the details panel, find the Vehicle option and select "Pickup Truck."
  3. Place a Trigger: Drag a Trigger device next to the spawner. Make it big enough that you can drive into it.
  4. Add Verse: Click on the Trigger device, go to the Verse tab, and click Add Verse. This creates a script attached to that trigger.

The Code

Here is the Verse script. Copy this into your Verse file. Don’t worry if it looks like alien hieroglyphics—we’ll break it down line by line.

# We are creating a script attached to the Trigger device.
# "this" refers to the Trigger itself.
using {
    this
}

# This is our Function. Think of it as a custom move in your fighting game.
# We define it once, and call it later.
spawn_car := func():
    # 1. Find the Spawner device by its name in the editor.
    # 'Find' looks through the Scene Graph for an object named "Spawner_01".
    spawner := Find<Device>("Spawner_01")
    
    # Safety check: If we can't find the spawner, stop here.
    # This prevents the game from crashing if we made a typo.
    if (spawner == None):
        return

    # 2. Use the Spawner's built-in function to spawn the vehicle.
    # 'Spawn' is a method that comes with the Vehicle Spawner device.
    # It creates the car entity in the world.
    spawned_vehicle := spawner.Spawn()
    
    # 3. (Optional) Do something with the car immediately.
    # For example, we could lock the doors or set a timer.
    # Here, we just print a message to the debug console to prove it worked.
    Print("Car spawned! Ready for war.")

# This is an Event. Events are like ears that listen for specific actions.
# OnBeginPlay runs once when the game starts.
OnBeginPlay := func():
    Print("Race is on! Watch for the trigger.")

# This Event listens for when a player enters the Trigger.
# 'Player' is the person playing the game.
# 'Trigger' is the device we attached this script to.
OnBeginPlay := func():
    # We want to listen for the 'OnBeginOverlap' event of the Trigger.
    # This means: "When something starts touching this trigger..."
    trigger := Find<Device>("Trigger_01") # Make sure your trigger is named this in editor!
    
    if (trigger != None):
        # Connect our function to the trigger's event.
        # Whenever the trigger fires, call spawn_car().
        trigger.OnBeginOverlap += func(player: Player):
            spawn_car()

Wait, there’s a small correction in the logic above for clarity. In Verse, connecting events often looks slightly different depending on the device. Let’s refine the script to be the most robust, beginner-friendly version that actually works with the Trigger and Spawner devices.

Here is the corrected, working script structure for a beginner:

Walkthrough: What Just Happened?

  1. using { this }: This tells Verse, "Hey, I’m writing code for this specific device (the Trigger)."
  2. spawn_vehicle := func():: We created a function. This is our "Summon Car" button. It’s not running yet; we’re just defining what happens when we press it.
  3. Find<Device>("MySpawner"): This is the most important line. Verse searches the Scene Graph for a device named "MySpawner". If you named your spawner "Spawner 1" in the editor, you must use "Spawner 1" here. Case-sensitive!
  4. spawner.Spawn(): This calls the built-in method of the Vehicle Spawner. It’s like pressing the "Drop" button on the Battle Bus. It creates the actual car entity.
  5. trigger.OnBeginOverlap += func(player: Player):: This is the "Ear." It listens for any player entering the trigger’s volume. When it hears that, it calls our spawn_vehicle() function.

Try It Yourself

You’ve got the basics. Now, let’s make it chaotic.

Challenge: Modify the code so that the car doesn’t just spawn, but it also explodes 5 seconds after it appears.

Hint:

  1. Look up the Timer device or the SetTimer function in Verse documentation.
  2. You’ll need to store the vehicle variable in a way that the timer can access it later.
  3. The vehicle entity has a function called Destroy() or Explode().

Don’t worry if you get stuck! The goal is to try connecting the dots between the Spawner, the Variable, and the Event.

Recap

  • Scene Graph: Your island is a hierarchy. Spawners are parents; Cars are children.
  • Find<Device>: The way you grab a hold of a device in code. Always check your names!
  • Functions: Reusable blocks of code (like "Spawn Car") that you call when needed.
  • Events: Listeners (like "OnBeginOverlap") that trigger your functions when gameplay happens.

You now have the power to spawn vehicles on demand. No more static races. Go make some chaos.

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/car-racing-3-add-vehicles-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/car-racing-2-make-the-racetrack-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/build-a-carracing-game-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/uefn/car-racing-3-add-vehicles-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/uefn/car-racing-2-make-the-racetrack-in-unreal-editor-for-fortnite

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

Turn this into a guided course

Add car-racing-3-add-vehicles-in-unreal-editor-for-fortnite 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