Verse Library verse

01 Fragment

Changes neon light colors when players step on a trigger volume.

verse-library/using-audio-and-visual-effect-galleries-in-fortnite-creative/01-fragment.verse

# NeonFlash.verse
# This script makes a neon light change color when a player steps on the trigger.

use {
    CoreGame,       # Basic game functions
    CoreAssets,     # For colors and assets
    Player,         # To detect players
}

# This is our main script. It lives on the Trigger Volume.
NeonFlash = script(
    # This is a 'Reference'. Think of it like a remote control.
    # We need to connect this to our Neon Light in the editor.
    NeonLight: ComponentReference<NeonLightComponent>,
    
    # This is the 'Trigger' that detects players.
    # We'll use the built-in trigger events.
    Trigger: ComponentReference<TriggerComponent>,
)

# This function runs when a player steps on the trigger.
# In Fortnite, this is like the 'Elimination' event for the floor.
OnPlayerStep = Trigger.PlayerEntered:Subscribe(
    func(Trigger: TriggerComponent, Player: Player): void = {
        # 'Player' is the person who stepped here.
        # We don't actually need to do anything with the player,
        # we just need to know someone is there.
        
        # Now, let's change the light color.
        # We're calling a function on our NeonLight reference.

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