Reference Devices compiles

creative_device: Your Verse Script in the World

Every Verse script you write in UEFN is a `creative_device`. It's the bridge between your code and a real object placed in the level: inherit from it, drop it in your island, and your `OnBegin` runs when the match starts. But it's more than a script holder — it can teleport, glide across the map, and hide itself, all from its own built-in API.

Updated Examples verified on the live UEFN compiler
Watch the Knotcreative_device in ~90 seconds.

Overview

When you create a Verse device in UEFN, you start by inheriting from creative_device. This single class does two jobs at once:

  1. It's the home for your code. You add @editable fields to reference the buttons, triggers, and props you placed in the level, and you put your game logic inside OnBegin<override>()<suspends>:void. That method runs automatically when the experience begins.
  2. It's also a real object in the world. Because a creative_device has a transform, it can move itself around the map. You can TeleportTo it instantly, MoveTo it smoothly over time, or Show/Hide it.

Reach for the creative_device API directly when you want the script object itself to be the gameplay element — a roaming objective marker, a platform that slides into place when a switch is hit, or a beacon that appears only during a special phase. Most of the time you'll combine its own API (move, teleport, show) with @editable references to other devices.

A key thing to understand: OnBegin is <suspends>, which means it's a coroutine. You can await long-running calls like MoveTo right inside it, and the rest of your island keeps running.

API Reference

(API surface could not be resolved for this device.)

Walkthrough

Let's build a moving objective platform. The platform (our Verse device, which uses a visible mesh) starts hidden at a staging point. When a player steps on a trigger, the platform appears and glides from a low position up to a raised position over 3 seconds — like a bridge extending across a gap. We use the device's own Show, TeleportTo, and MoveTo methods, plus an @editable trigger_device reference.

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

# A Verse-authored creative device placed in the level.
moving_platform_device := class(creative_device):

    # Reference to a trigger we placed in the world.
    @editable
    StartTrigger : trigger_device = trigger_device{}

    # The low (start) and raised (end) world positions, in cm.
    var LowPosition : vector3 = vector3{ X := 0.0, Y := 0.0, Z := 200.0 }
    var HighPosition : vector3 = vector3{ X := 0.0, Y := 0.0, Z := 800.0 }

    OnBegin<override>()<suspends> : void =
        # Hide the platform until the player triggers it.
        Hide()

        # Snap the device to its low starting spot (no animation).
        StartingTransform := GetTransform()
        if (TeleportTo[LowPosition, StartingTransform.Rotation]):
            # Successfully positioned.

        # React when a player steps on the trigger.
        StartTrigger.TriggeredEvent.Subscribe(OnTriggered)

    # Event handler — must be a method at class scope.
    OnTriggered(Agent : ?agent) : void =
        # Run the reveal-and-move sequence concurrently so the
        # handler returns immediately.
        spawn{ RaisePlatform() }

    RaisePlatform()<suspends> : void =
        # Make the platform visible and enable collisions.
        Show()

        # Glide from the current spot up to the high position over 3s.
        CurrentRotation := GetTransform().Rotation
        Result := MoveTo(HighPosition, CurrentRotation, 3.0)

Line by line:

  • moving_platform_device := class(creative_device): — we inherit from creative_device, so UEFN shows this in the content browser and gives us OnBegin, MoveTo, TeleportTo, Show, and Hide.
  • @editable StartTrigger : trigger_device — declares a slot you fill in the UEFN Details panel by picking a placed trigger. You can ONLY call placed devices through fields like this.
  • var LowPosition/var HighPosition — plain vector3 values (positions in centimeters). Note we use 0.0, not 0 — Verse never auto-converts int to float.
  • Hide() — the device's own method, hides it and disables collision until we're ready.
  • GetTransform() — reads this device's current transform so we can reuse its rotation.
  • if (TeleportTo[LowPosition, ...]):TeleportTo is <decides>, meaning it can fail, so it's called with square brackets inside an if. This instantly places the device.
  • StartTrigger.TriggeredEvent.Subscribe(OnTriggered) — we subscribe a method to the trigger's event. Always subscribe inside OnBegin.
  • OnTriggered(Agent : ?agent) — the handler. The trigger hands an optional agent. We spawn the raising sequence so the handler doesn't block.
  • RaisePlatform()<suspends> — a coroutine. Show() reveals the device, then MoveTo(...) smoothly animates it to HighPosition over 3.0 seconds and awaits completion.

Common patterns

Teleport the device to a player's location

Use GetTransform to read a target and TeleportTo (a <decides> call) to snap the device. Here a beacon-style device relocates itself when a button is pressed.

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

relocating_beacon_device := class(creative_device):

    @editable
    SummonButton : button_device = button_device{}

    @editable
    HomeMarker : creative_prop = creative_prop{}

    OnBegin<override>()<suspends> : void =
        SummonButton.InteractedWithEvent.Subscribe(OnPressed)

    OnPressed(Agent : agent) : void =
        # Read where the marker prop sits, then jump the device there.
        TargetTransform := HomeMarker.GetTransform()
        if (TeleportTo[TargetTransform.Translation, TargetTransform.Rotation]):
            Show()

Glide the device along a loop with MoveTo

MoveTo is <suspends> and returns a move_to_result, so you can chain movements in a loop to make a patrolling platform.

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

patrol_platform_device := class(creative_device):

    var PointA : vector3 = vector3{ X := 0.0, Y := 0.0, Z := 300.0 }
    var PointB : vector3 = vector3{ X := 600.0, Y := 0.0, Z := 300.0 }

    OnBegin<override>()<suspends> : void =
        Rot := GetTransform().Rotation
        loop:
            MoveTo(PointA, Rot, 2.0)
            MoveTo(PointB, Rot, 2.0)

Show and hide the device as a phase signal

The simplest API: Show and Hide toggle the device's visibility and collision. Drive them from device events.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

phase_marker_device := class(creative_device):

    @editable
    RevealButton : button_device = button_device{}

    @editable
    HideButton : button_device = button_device{}

    OnBegin<override>()<suspends> : void =
        Hide()
        RevealButton.InteractedWithEvent.Subscribe(OnReveal)
        HideButton.InteractedWithEvent.Subscribe(OnHide)

    OnReveal(Agent : agent) : void =
        Show()

    OnHide(Agent : agent) : void =
        Hide()

Gotchas

  • You can't call placed devices directly. Writing SomeTrigger.TriggeredEvent... only works if SomeTrigger is an @editable field on your creative_device. A bare reference to a level device gives 'Unknown identifier'.
  • TeleportTo is <decides>, MoveTo is <suspends>. Call TeleportTo with square brackets inside an if (it can fail). Call MoveTo from a <suspends> context (like OnBegin or a spawned coroutine) — you can't call it from a plain void method.
  • Don't block your event handlers. MoveTo takes real time. If you call a multi-second move directly inside a non-suspending handler it won't compile; wrap it in spawn{ ... } and put the move in a separate <suspends> method.
  • int vs float. Positions are vector3 of floats and MoveTo's OverTime is a float. Always write 3.0, never 3. Verse will not convert for you.
  • ?agent vs agent. trigger_device.TriggeredEvent hands a ?agent (optional) while button_device.InteractedWithEvent hands an agent. Unwrap an optional with if (A := Agent?): before using it.
  • Hide disables collision. A hidden creative_device (or creative_prop) won't be steppable or shootable. Call Show before players are meant to interact with it.
  • OnEnd coroutines may not run. The docs note coroutines spawned inside OnEnd may never execute, so don't rely on long-running cleanup there.

Guides & scripts that use creative_device

Step-by-step tutorials that put this object to work.

Build your own lesson with creative_device

Generate a personalized, step-by-step lesson plan built around this object — grounded in this exact reference and our compile-verified knowledge base.

Build a lesson →