Verse Library verse

01 Fragment

Defines a reusable device blueprint for managing race state, laps, and checkpoint hierarchies.

verse-library/using-race-manager-devices-in-fortnite-creative/01-fragment.verse

# This script defines the logic for a custom Race Manager behavior.
# It demonstrates how to link a Manager to its Checkpoints.

using { /Fortnite.com/Devices }

# 1. Define the Device Type
# This is like creating a new blueprint. We are telling Verse:
# "This device is a Race Manager, and it knows about Checkpoints."
const MyRaceManager: device = {
    # The 'Name' is the identifier you see in the Event Browser.
    # Rename this in the editor to something like "MainRaceMgr".
    Name = "ProRaceManager"
    
    # TotalLaps is a Constant. It's set once and never changes during the race.
    # Think of this like the Battle Pass tier you unlocked—it's fixed.
    TotalLaps: int = 3
    
    # CurrentLap is a Variable. It changes as players progress.
    # Think of this like your XP bar filling up.
    CurrentLap: int = 0
    
    # RaceActive is a Boolean (True/False).
    # Think of this like the Storm being active or not.
    RaceActive: bool = false
    
    # List of Checkpoints.
    # This is the Scene Graph hierarchy. These are the "Children."
    # In the editor, you drag Race Checkpoint devices into this slot.
    Checkpoints: [device] = []
}

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in