Verse Library verse

01 Fragment

Rapidly turns a light on and off to simulate a haunted flickering torch.

verse-library/light-types-and-mobility/01-fragment.verse

using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/Structs }

# This is our "Haunted Torch" script.
# It makes a light flicker like it's haunted (or broken).

Haunted_Torch = script (struct):
    # 1. The "Loot Drop" - We need a reference to the light.
    # In Verse, we grab the device we placed in the editor.
    Light_Device: Customizable_Light = ""

    # 2. The "Storm Timer" - How fast does it flicker?
    Flicker_Speed: float = 0.1 # 0.1 seconds per flicker

    On_Begin_Play ():
        # This runs once when the island starts.
        # We start a loop that will keep flickering forever.
        Loop_Flicker ()

    Loop_Flicker ():
        # This is an infinite loop. Like a respawn timer that never ends.
        repeat (true):
            # Turn the light OFF
            Light_Device.Set_Is_Active (false)
            
            # Wait for a tiny moment (like a frame skip)
            Wait (Flicker_Speed)
            
            # Turn the light ON
            Light_Device.Set_Is_Active (true)

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