Verse Library verse

01 Device

Links button input to water height changes for interactive pool mechanics.

verse-library/using-water-devices-in-fortnite-creative/01-device.verse

# Import the devices we need to use
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# This is our main island script
my_island := class(creative_device):

    # Wire your Water Device here in the UEFN Details panel
    @editable
    Pool : water_device = water_device{}

    # Wire your Button Device here in the UEFN Details panel
    @editable
    SecretButton : button_device = button_device{}

    # This variable holds the water height
    # It starts at 0.0 (no water)
    # 'var' means we are allowed to change it later
    var WaterHeight : float = 0.0

    # This function raises the water
    # It takes one number as input
    RaiseWater(Level : float) : void =
        # We update our variable with the new level
        set WaterHeight = Level

        # We tell the water device to enable (show water)
        # and use SetWaterBodyHeight to move the surface
        # note: water_device exposes Enable/Disable and

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