Verse Library verse

01 Device

Links a trigger volume to an item spawner, automatically granting loot to players who enter the zone.

verse-library/add-item-spawner-devices/01-device.verse

# This is a simplified Verse script showing the logic behind the device settings.
# In UEFN, item_spawner_device and trigger_device are the real device types
# you reference in Verse. You bind them as properties on a creative_device
# subclass and wire them up in the UEFN editor.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# creative_device is the base class for all placeable Verse devices in UEFN.
loot_goblin_manager := class(creative_device):

    # Drag your Item Spawner device onto this property in the UEFN Details panel.
    # item_spawner_device is the real Verse type for the Item Spawner device.
    @editable
    My_Loot_Spawner : item_spawner_device = item_spawner_device{}

    # Drag your Trigger device onto this property in the UEFN Details panel.
    # trigger_device is the real Verse type for the Trigger Volume device.
    @editable
    My_Trigger : trigger_device = trigger_device{}

    # OnBegin runs automatically when the game session starts.
    # This matches "Enabled At Game Start = No" on the spawner —
    # we disable it here so it doesn't fire immediately.
    OnBegin<override>()<suspends> : void =
        My_Loot_Spawner.Disable()

        # Subscribe to the trigger's overlap event.
        # TriggeredEvent fires when a player enters the Trigger Volume.

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