Verse Library verse

01 Device

Activates and instantly spawns a sedan vehicle at a designated race track starting point.

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

# This is a comment. It helps us remember what the code does.

using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/Diagnostics }

# We define a class that holds our Sedan Spawner device.
# In UEFN, devices are wired in the editor, not created in code.
# Think of this as naming the toy car box we already placed.
race_manager := class(creative_device):

    # my-car-spawner is a variable that refers to the
    # Sedan Spawner device we placed on the island.
    # Wire this device in the UEFN editor Details panel.
    @editable
    my-car-spawner : sedan_spawner_device = sedan_spawner_device{}

    # OnBegin runs automatically when the game starts.
    # This is like pressing the "Go" button on your race track.
    OnBegin<override>()<suspends> : void =

        # We tell the spawner to activate and create the car.
        # Enable() wakes up the device so it is ready to spawn.
        # This is like saying "The car box is now open and ready."
        my-car-spawner.Enable()

        # SpawnVehicle() makes the car appear at the device's
        # location and facing direction (orientation).
        # The device's position and rotation are set in the
        # editor, so the car faces the track automatically.
        # This is the magic moment — the car pops into existence!

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