Verse Library verse

01 Using Map Controller In Verse

Activates a map controller for all agents and dynamically adjusts its capture box size.

extracted-snippets/documentation/en-us/fortnite-creative/using-map-controller-devices-in-fortnite-creative/01-using-map-controller-in-verse.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-map-controller-devices-in-fortnite-creative
# Local doc:  epic-docs/documentation/en-us/fortnite-creative/using-map-controller-devices-in-fortnite-creative.md
# Section:    Using Map Controller in Verse
using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Verse.org/Simulation }

# A Verse-authored creative device that can be placed in a level
map_controller_device_verse_example := class(creative_device):

    # Reference to the Map Controller Device in the level.
    # In the Details panel for this Verse device,
    # set this property to your Map Controller Device.
    @editable
    MyMapControllerDevice:map_controller_device = map_controller_device{}

    # Runs when the device is started in a running game
    OnBegin<override>()<suspends>:void=
        # Wait before making a change.
        Sleep(1.75)

        # Adds the map controller to all `agent`s in the experience.
        # If multiple map controllers are active for an `agent`, the one with the highest *Map Priority* is used.
        MyMapControllerDevice.Activate()

        # Wait before making a change.
        Sleep(1.75)

        # Returns the *Capture Box Size* (in meters).
        MapCaptureBoxSize:float = MyMapControllerDevice.GetCaptureBoxSize()

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