Verse Library verse

01 Device

Activates a boat vehicle spawner when a player enters a designated trigger volume to summon a ride.

verse-library/boat-spawner-device-design-examples/01-device.verse

# This line imports the core Verse libraries we need.
# Think of this as loading the "engine" of the game into our script.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Game }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

# This is our main script. It attaches to the Vehicle Spawner (Boat) device.
# 'vehicle_spawner_boat_device' is the real Verse type for the Boat Spawner placed in your island.
# We extend it so we can react to its built-in events.
boat_spawner_script := class(creative_device):

    # VARIABLES: These are containers for data.
    # We hold a reference to the vehicle_spawner_boat_device placed on the island.
    # Wire this up in the UEFN details panel by making it @editable.
    @editable
    BoatSpawner : vehicle_spawner_boat_device = vehicle_spawner_boat_device{}

    # We also hold a reference to a trigger_device the player walks into
    # to request the boat.  Wire a Trigger device here in the details panel.
    # Using a trigger is the standard pattern because vehicle_spawner_boat_device
    # does not expose a direct player-interact event in the current SDK.
    @editable
    InteractTrigger : trigger_device = trigger_device{}

    # 'BoatAlreadySpawned' tracks whether we have already fired the spawner
    # so we don't keep spawning new boats.
    var BoatAlreadySpawned : logic = false

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