Build a Dirt Bike Race Track in Fortnite Creative
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.
Build a Dirt Bike Race Track in Fortnite Creative
Do you love speed? Do you like zooming around on two wheels? In this tutorial, you will learn how to add a fast Dirt Bike to your island. You will also learn how to make players spawn right on it. This is perfect for a race map or a combat arena. Let's build something fun!
What You'll Learn
- How to find the Dirt Bike Spawner device.
- What a Spawner does in Fortnite Creative.
- How to set up a simple race start line.
- The basics of Contextual Filtering in device settings.
How It Works
Imagine you are at a toy store. You see a box with a cool bike inside. The box is like a Spawner device. When you open the box, the bike appears. In Fortnite, the Spawner device creates the bike when the game starts or when a player touches it.
The Dirt Bike is fast and agile. It is great for races. It is also good for shooting while driving. This makes gameplay exciting!
What is a Spawner?
A Spawner is a device that creates objects. Think of it like a magic cookie cutter. When you press play, the spawner "cuts out" the bike and places it in the world. Players can then hop on and drive away.
Renaming Devices
If you have many bikes, names help you stay organized. You can Rename a device. This means giving it a special name. For example, name one "Race Bike" and another "Combat Bike." This helps you find them later.
Contextual Filtering
You might see some options hide or show up. This is called Contextual Filtering. It is like a smart menu. It only shows the options you need right now. This keeps the screen clean. It makes your island easier to build.
Let's Build It
We will build a simple starting area. Players will spawn on the bike immediately. This is great for a quick race.
Step 1: Place the Spawner
- Open your Device tab.
- Search for Dirt Bike Spawner.
- Place it on your island. Put it on a flat surface.
Step 2: Configure the Spawner
Click on the device to open its settings. Look for the Spawn Behavior section.
- Spawn On Game Start: Turn this ON. The bike will be there when the match begins.
- Auto-Pilot: Turn this OFF. You want players to drive, not the bike driving itself.
- Respawn Time: Set this to a high number. If they crash, they should wait a bit.
Step 3: Connect the Player (Verse Code)
Now we use Verse to make sure players get on the bike. We need to tell the game: "When a player touches the bike, put them on it."
Here is the code. Copy it into a Verse script attached to your Spawner.
# This script makes players spawn on the bike automatically.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# We define our Dirt Bike Spawner here.
# Think of this as naming our magic box.
dirt_bike_race_manager := class(creative_device):
# Drag your Dirt Bike Spawner device onto this property
# in the UEFN details panel.
@editable
var BikeSpawner : vehicle_spawner_dirtbike_device = vehicle_spawner_dirtbike_device{}
# This function runs when the game starts.
OnBegin<override>()<suspends>: void =
# Subscribe to the spawned event so we act
# as soon as the vehicle exists in the world.
BikeSpawner.SpawnedEvent.Subscribe(OnBikeSpawned)
# This function is called each time the spawner
# creates a new vehicle.
# note: vehicle_spawner_device.SpawnedEvent passes the
# fort_vehicle that was spawned.
OnBikeSpawned(Vehicle : fort_vehicle): void =
# Get all agents currently associated with the spawner
# and attempt to add them to the vehicle.
# note: There is no direct EnterVehicle() on
# vehicle_spawner_device; AddAgent on fort_vehicle is the
# supported way to seat a player via Verse.
if (Agent := BikeSpawner.Vehicle?):
Vehicle.AddAgent[Agent]```
### What Does This Code Do?
1. **`using`**: This brings in the tools we need. It is like grabbing your toolbox.
2. **`var BikeSpawner`**: This creates a variable for our device. A **variable** is a box that holds data. Here, it holds the bike device.
3. **`OnBegin`**: This is an **Event**. An event is something that happens. Here, it happens when the game starts.
4. **`SpawnedEvent.Subscribe`**: This watches for the moment the bike appears. When it does, it calls our next function.
5. **`OnBikeSpawned`**: This function runs the moment a bike is created by the spawner.
6. **`for player in World.GetPlayers()`**: This is a **Loop**. A loop repeats actions. It checks every player in the game.
7. **`BikeSpawner.EnterVehicle(Character)`**: This command makes the player sit on the bike.
### Step 4: Test It!
1. Save your island.
2. Press **Play**.
3. Watch your character. Do they appear on the bike?
4. Drive around! Feel the speed!
## Try It Yourself
You did it! You have a working Dirt Bike. Now, let's make it harder.
**Challenge:** Add a second Dirt Bike Spawner. Name it "Red Bike." Make it appear only after 10 seconds.
**Hint:** You can use a **Timer Device**. Connect the Timer to the Spawner. Set the timer for 10 seconds. This is called a **Constant** because the time (10 seconds) does not change.
## Recap
You learned how to use the Dirt Bike Spawner device. You learned what a **Spawner** is. You wrote Verse code to make players sit on the bike automatically. You also learned about **Contextual Filtering** and **Renaming**. Great job! Keep building and having fun.
## References
* https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-dirt-bike-spawner-devices-in-fortnite-creative
* https://dev.epicgames.com/documentation/en-us/fortnite/using-dirt-bike-spawner-devices-in-fortnite-creative
* https://dev.epicgames.com/documentation/en-us/fortnite/using-devices-in-fortnite
* https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-devices-in-fortnite-creative
* https://dev.epicgames.com/documentation/en-us/fortnite/using-sportbike-spawner-devices-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add using-dirt-bike-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.