using { /Engine/Engine }
using { /Verse.org/Simulation }
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices }
using { /Engine/SceneGraph }
# This is our main script. It runs on the island.
# Think of it as the game director controlling the lights.
mood_lighting := class(creative_object):
# We need to reference the button and the two lights.
# These are "variables" that hold pointers to our actors.
MoodButton: button_device = ?
InterrogatorLight: creative_object = ?
VibesLight: creative_object = ?
# This function runs when the island starts.
# It's like loading the map.
OnBegin<override>()<suspends>: void =
# First, we check if we actually have the button and lights.
# If not, we stop and yell at the user (in logs).
if MoodButton == ? or InterrogatorLight == ? or VibesLight == ?
print("Error: Missing Button or Lights! Check your names.")
return
# Now, we tell the Button: "When you are pressed, run this code."
# This is called "binding an event."
MoodButton.OnButtonPressed.Bind<override>(
func (pressed_button: button_device): void =
Verse Library
verse
01 Standalone
Toggles rectangular area lights when a button is pressed, enabling dynamic environmental mood control.
verse-library/rectangular-area-lights/01-standalone.verse
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.