Verse Library verse

01 Device

Starts music automatically on begin and stops it when players step on a designated trigger.

verse-library/using-patchwork-in-unreal-editor-for-fortnite/01-device.verse

# This is the main script for our beat box island.
# It controls the music player.

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

# We create a new type called BeatBox.
# This is like a blueprint for our island logic.
BeatBox := class(creative_device):

    # This is a variable for our music device.
    # It holds the Patchwork Music Player.
    # Drag your Patchwork Music Player device onto this property
    # in the UEFN Details panel after uploading the script.
    @editable
    MusicPlayer : speaker_device = speaker_device{}

    # This is a variable for the stop trigger device.
    # It listens for a player stepping on it to stop the music.
    # Drag a Trigger device (your "StopWall") onto this property
    # in the UEFN Details panel.
    @editable
    StopTrigger : trigger_device = trigger_device{}

    # This function runs when the game starts.
    OnBegin<override>()<suspends>: void =

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