Verse Library verse

01 Using Speaker In Verse

Controls a patchwork speaker device, toggling it on and off after a delay in Verse.

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

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/using-patchwork-speaker-devices-in-fortnite-creative
# Local doc:  epic-docs/documentation/en-us/fortnite/using-patchwork-speaker-devices-in-fortnite-creative.md
# Section:    Using Speaker in Verse
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# A Verse-authored creative device that can be placed in a level
speaker_example := class(creative_device):
@editable
Speaker:patchwork_speaker_device = patchwork_speaker_device{}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
Sleep(5.0)
Speaker.Disable()
Print("Device Disabled")
Sleep(5.0)
Speaker.Enable()
Print("Device Enabled")

Comments

    Sign in to vote, comment, or suggest an edit. Sign in