Verse Library verse

01 Standalone

Executes a Niagara particle effect at the exact location when a player interacts with an object.

verse-library/niagara-overview/01-standalone.verse

# LootGoblinTrigger.v
# This script spawns a Niagara effect when a player hits a button.

using { /Fortnite.com/Devices }
using { /Verse.org/Sim }
using { /UnrealEngine.com temporary/Engine }

# This is our "Loot Goblin" script.
# It's like a custom rule for a specific device.
LootGoblinTrigger = script():

    # Variables: The "Loot" and the "Effect"
    # We link these in the UEFN editor later.
    LootButton := struct{}:
        InteractAction: InteractAction
    
    SparkEffect := struct{}:
        NiagaraSystem: NiagaraSystem

    # This function runs when the game starts
    OnStart(): override=
        # We don't need to do anything yet, 
        # but we're ready to listen for inputs.
        pass

    # This function runs when the button is pressed
    OnInteract(Actor: Actor, Action: InteractAction): override=
        # Check if this is the "Activate" action (the main press)
        if Action == InteractAction.Activate:
            # Get the location of the actor (the button)

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