Verse Library verse

01 Using Song Sync In Verse

Demonstrates how to programmatically enable and disable a Patchwork song sync device during gameplay.

extracted-snippets/documentation/en-us/fortnite-creative/using-patchwork-song-sync-devices-in-fortnite-creative/01-using-song-sync-in-verse.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-patchwork-song-sync-devices-in-fortnite-creative
# Local doc:  epic-docs/documentation/en-us/fortnite-creative/using-patchwork-song-sync-devices-in-fortnite-creative.md
# Section:    Using Song Sync in Verse
using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/Patchwork }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# A Verse-authored creative device that can be placed in a level

song_sync_example := class(creative_device):

    @editable

    SongSync:song_sync_device = song_sync_device{}

    # Runs when the device is started in a running game

    OnBegin<override>()<suspends>:void=

       
        Sleep(5.0)

        SongSync.Disable()

        Print("Device Disabled")

        Sleep(5.0)

        SongSync.Enable()

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