Drift Into the Neon City: Your First Verse Car Spawner
Tutorial beginner

Drift Into the Neon City: Your First Verse Car Spawner

Updated beginner

Drift Into the Neon City: Your First Verse Car Spawner

Welcome, young creators! Are you ready to build a super-fast racing island? We are going to use a special tool called the Nitro Drifter. It is a cool, neon car that looks like it belongs in a futuristic city.

In this tutorial, you will learn how to make a car appear when a player touches a spot. You will also learn how to change the car's color. This is like magic, but it is actually code! Let’s start building.

What You'll Learn

  • What a Device is in Fortnite Creative.
  • How to use Verse to make things happen.
  • How to change a car’s Color using code.
  • How to test your new racing track.

How It Works

Imagine you are playing a video game. You walk up to a magic circle on the ground. Poof! A car appears right in front of you. That is what we are building.

In Fortnite Creative, we use Devices. A device is like a robot helper. It waits for a signal. When it gets the signal, it does a job. We will use the Nitro Drifter Spawner device. This device holds a cool car.

We will use Verse to connect two things. First, we tell the game: "When a player touches this spot..." Second, we say: "...spawn a car here!"

We will also add a fun twist. We will make the car change color! Think of a variable like a light switch. You can flip it to change the light from red to blue. In code, we can flip a switch to change a car’s color.

Let's Build It

First, open your island in UEFN. Go to the Devices tab. Search for Nitro Drifter Spawner. Place it on your track.

Now, open the Verse Editor. We will write some code. This code tells the spawner what to do.

Copy this code into your Verse file. It is ready to use!

# This is a Verse script for a Nitro Drifter Spawner.
# It makes a car appear when a player touches a trigger.

using { /Fortnite.com/Devices }

# We create a new "Device" named MyCarSpawner.
# This links our code to the device in the game world.
device MyCarSpawner : NitroDrifterSpawnerDevice = {
    # This is the "On Player Enters" event.
    # It fires when a player walks into the device.
    OnPlayerEnters := event (player: Player) -> () {
        
        # This line spawns the car!
        # The car appears at the device's location.
        SpawnVehicle(player)
        
        # Let's change the car's color!
        # We pick a random color from a list.
        # This makes every car look unique.
        SetColor(RandColor())
    }
}

# We need a helper function to get a random color.
# This keeps our main code clean and easy to read.
RandColor := () -> Color {
    # We pick a random number between 0 and 100.
    # Then we use that number to pick a color.
    # This is like rolling dice to pick a color!
    return Color {
        R = RandInt(0, 255) / 255.0,
        G = RandInt(0, 255) / 255.0,
        B = RandInt(0, 255) / 255.0
    }
}

Walkthrough: What Does Each Part Do?

  1. device MyCarSpawner: This line creates a link. It connects your code to the Nitro Drifter device you placed in the world. Think of it like plugging a lamp into a wall socket.
  2. OnPlayerEnters: This is an Event. An event is something that happens in the game. It is like a doorbell. When the doorbell rings, you know someone is there. Here, the "doorbell" rings when a player walks in.
  3. SpawnVehicle(player): This is a Function. A function is a set of instructions. This function tells the game to create the car. It gives the car to the player who walked in.
  4. SetColor: This changes how the car looks. We use a helper function called RandColor. This picks a random mix of Red, Green, and Blue. It makes the car look shiny and new every time!

Try It Yourself

Great job! You have a working car spawner. Now, let’s make it even cooler.

Challenge: Change the color to a specific color instead of a random one.

Hint: Look at the RandColor function. Instead of using RandInt, you can type in a specific number for Red, Green, and Blue.

  • Red is { R: 1.0, G: 0.0, B: 0.0 }.
  • Blue is { R: 0.0, G: 0.0, B: 1.0 }.

Try making the car bright yellow! Can you guess what numbers to use for yellow? (Hint: Yellow is a mix of Red and Green!)

Recap

You just built your first Verse-powered device! You learned how to use a Nitro Drifter Spawner. You saw how Events like "Player Enters" can trigger actions. You even changed a car’s Color using code.

Remember, coding is like building with LEGO. You start with small blocks. Then you build big, fun things. Keep experimenting with your island. You are doing amazing work!

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/using-nitro-drifter-spawner-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-nitro-drifter-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/using-devices-in-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-driftboard-spawner-devices-in-fortnite-creative

Verse source files

Turn this into a guided course

Add using-nitro-drifter-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.

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