using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /Verse.org/Native } # This is our main script block. # It holds our variables and logic. beacon_controller := class(creative_device) { # A variable to hold our light device. # We will set this in the editor. @editable MyLight: customizable_light_device = customizable_light_device{} # A variable for brightness, stored as a float we can change. # Light Function materials are set up in the editor; we drive # pulsing by toggling the light device's intensity instead. # note: Verse has no runtime LightFunctionMaterial API; brightness # is approximated via the customizable_light_device Enable/Disable cycle. var IsBright : logic = true # This event runs when the game starts. OnBegin(): void = { # Start the pulsing loop immediately. PulseLight() } # This is a custom function. # It makes the light get brighter and dimmer. PulseLight(): void = { # We loop forever. loop { # Set the light to its full "bright" state. # The light function material (set in the editor) is now visible. MyLight.Enable() # Wait for 1 second. # This pauses the code briefly. Sleep(1.0) # Disable the light to simulate the "dim" state. MyLight.Disable() # Wait for 1 second again. Sleep(1.0) } } }