Verse Library verse

01 Using Value Setter In Verse

References a Patchwork device, sleeps, and toggles its enabled state while printing status messages.

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

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/using-patchwork-value-setter-devices-in-fortnite-creative
# Local doc:  epic-docs/documentation/en-us/fortnite/using-patchwork-value-setter-devices-in-fortnite-creative.md
# Section:    Using Value Setter 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
value_setter_example := class(creative_device):
@editable
ValueSetter:patchwork_value_setter_device = patchwork_value_setter_device{}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
Sleep(5.0)
ValueSetter.Disable()
Print("Device Disabled")
Sleep(5.0)
ValueSetter.Enable()
Print("Device Enabled")

Comments

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