Verse Library verse

01 Device

Automatically spawns surfboard items when players enter a designated race starting zone.

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

# This is a simple script for a Surfboard Race Start
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# We declare our device class.
# In UEFN, devices are placed in the editor and
# referenced as editable properties — they cannot
# be created with a .Create() call at runtime.
surfboard_race_manager := class(creative_device):

    # 1. We define the "Trigger".
    # A trigger is an invisible box.
    # When a player enters it, it fires.
    # Drag a trigger_device onto this property in the UEFN editor.
    @editable
    MyStartTrigger : trigger_device = trigger_device{}

    # 2. We define the "Spawner".
    # This device creates the surfboard.
    # Drag a item_spawner_device onto this property in the UEFN editor.
    # note: UEFN exposes surfboard spawning through item_spawner_device;
    # set its Item property to the Surfboard item in the editor.
    @editable
    MySurfboardSpawner : item_spawner_device = item_spawner_device{}

    # OnBegin runs automatically when the island starts.
    OnBegin<override>()<suspends> : void =

        # 3. We connect them.

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