Verse Library verse

02 Standalone

Uses trigger volume events to automatically enable or disable environmental post-process visual filters.

verse-library/using-post-process-devices-in-fortnite-creative/02-standalone.verse

using /Fortnite.com/Devices

# Our blueprint for the Spooky Trap
spooky_trap := class(device):
    # Variable: Stores the reference to the Post Process device
    # We will link this in the editor by name or reference
    post_process_device: PostProcessDevice = PostProcessDevice{}
    
    # Variable: Stores the reference to the Trigger Volume
    trigger_volume: TriggerVolume = TriggerVolume{}

    # When the island starts...
    OnBegin<override>()<suspends>: void=
        # Wait a frame to ensure devices are loaded
        await GetWorld().GetTimer().Wait(0.0)
        
        # Wire up the events.
        # When a player enters the trigger, run 'MakeItSpooky'
        trigger_volume.OnPlayerEnter += MakeItSpooky
        # When a player leaves, run 'MakeItNormal'
        trigger_volume.OnPlayerLeave += MakeItNormal

    # The "Spooky" function
    MakeItSpooky := func(player: Player): void=
        # Activate the Post Process device
        # This applies the green tint, vignette, etc. we set in the editor
        post_process_device.Activate()

    # The "Normal" function
    MakeItNormal := func(player: Player): void=

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