Verse Library verse

01 Device

Activates a crash pad when a player enters a designated trigger volume.

verse-library/device-design-examples-in-fortnite-creative/01-device.verse

# We are defining a new Script. Think of this as the "Brain" for our trigger.
# It needs to know about the Trigger Volume (trigger_device) and the
# specific launcher (launch_pad_device).

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

chaos_trigger := class(creative_device):

    # This is our "Inventory" of tools.
    # 'MyLauncher' is a variable that will hold the D-Launcher (crash pad) device.
    # We mark it as '@editable' so we can drag-and-drop the actual device
    # from the world into this slot in the editor.
    @editable
    MyLauncher : crash_pad_device = crash_pad_device{}

    # 'MyTrigger' holds the Trigger Volume we want to listen to.
    @editable
    MyTrigger : trigger_device = trigger_device{}

    # This is the main function. It runs once when the island starts.
    OnBegin<override>()<suspends> : void =
        # 2. LISTEN FOR INPUT
        # We want to know when a player enters the Trigger Volume.
        # We call the Trigger's "TriggeredEvent" and subscribe to it.
        # This is like saying: "Hey Trigger, ring this bell every time someone walks in."
        # We connect that bell to our 'HandlePlayerEnter' function below.
        MyTrigger.TriggeredEvent.Subscribe(HandlePlayerEnter)

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