Verse Library verse

01 Device

Moves a weapon prop toward players whenever they step inside a designated trigger.

verse-library/general/01-device.verse

# LootGoblinScript.verse
# This script makes a creative prop teleport when a player enters a trigger.

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

# 2. DEFINING THE DEVICE
# In UEFN, Verse scripts attached to the level are creative_device subclasses.
# We expose the trigger device so it can be wired in the editor Details Panel.
loot_goblin_script := class(creative_device):

    # 3. EDITABLE REFERENCES
    # Drag your Trigger Device and prop_manipulator_device into these slots
    # in the UEFN Details Panel.
    @editable
    Trigger : trigger_device = trigger_device{}

    # prop_manipulator_device lets us move a placed creative prop at runtime.
    # Wire this to a Prop Manipulator device placed on your weapon prop.
    @editable
    GoblinProp : prop_manipulator_device = prop_manipulator_device{}

    # 4. ENTRY POINT
    # OnBegin runs once when the island starts. We use it to subscribe to events.
    OnBegin<override>()<suspends> : void =
        # Subscribe our handler to the trigger's TriggeredEvent.

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