Verse Library verse

01 Device

Activates an audio source with patchwork echo effects when players enter a trigger zone.

verse-library/using-patchwork-echo-effect-devices-in-fortnite-creative/01-device.verse

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

# Canyon echo coordinator — wires up devices that are
# already placed in the UEFN level via their @editable bindings.
# Patchwork audio routing is configured in the editor;
# this script handles the gameplay trigger that starts playback.

canyon_echo_manager := class(creative_device):

    # Drag the placed Audio Player device here in the Details panel.
    @editable
    MusicSource : audio_player_device = audio_player_device{}

    # Drag the placed Trigger Volume device here in the Details panel.
    # The Echo Effect and Output devices are wired to MusicSource
    # inside Patchwork — no Verse API is needed for that routing.
    @editable
    EntranceTrigger : trigger_device = trigger_device{}

    OnBegin<override>()<suspends> : void =
        # Subscribe to the trigger so playback starts when a
        # player walks into the Canyon Chamber.
        EntranceTrigger.TriggeredEvent.Subscribe(OnPlayerEntered)

    # Called automatically each time the trigger fires.
    # 'Agent' is the player who stepped inside.
    OnPlayerEntered(Agent : ?agent) : void =
        # Start the music source.

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