Verse Library verse

01 Device

Configures player spawn pads with team restrictions and visibility controls to manage safe player spawning zones.

verse-library/add-a-player-spawner/01-device.verse

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

# We are defining a custom device that acts as a smart spawner
SpawnRoomDevice := class(creative_device):
    # This is the "slot" where we drag the Player Spawner device in the editor
    # Think of this as the "empty bus" waiting for a player
    @editable
    SpawnPad : player_spawner_device = player_spawner_device{}

    # This function runs when the game starts
    OnBegin<override>()<suspends> : void =
        # 1. Set the Team
        # Only Team 1 players can use this pad.
        # If a Team 2 player tries to spawn here, they'll get kicked to the next available spawner.
        # note: Team index 1 maps to Team 1 in the device's Team property (0 = any team)
        # note: SetTeam is an epic_internal API; configure the Team property in the UEFN Details panel instead.

        # 2. Hide the Pad
        # We don't want players to see the spawn pad floating in the air.
        # It should look like just the floor.
        SpawnPad.Disable()
        # note: player_spawner_device has no SetVisibleInGame API; use the editor's
        # "Visible in Game" property directly on the device, or toggle with Disable/Enable
        # to disable the spawner entirely. For visibility-only control, set
        # "Visible in Game = Off" in the device's Details panel in UEFN.

        # 3. Optional: Set Priority
        # This is the "VIP line" for spawning.

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