Verse Library verse

01 Device

Automatically assigns players to newly spawned dirt bikes. Ideal for race tracks or vehicle drop mechanics.

verse-library/using-dirt-bike-spawner-devices-in-fortnite-creative/01-device.verse

# 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

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