Overview
When you create a Verse device in UEFN, you start by inheriting from creative_device. This single class does two jobs at once:
- It's the home for your code. You add
@editablefields to reference the buttons, triggers, and props you placed in the level, and you put your game logic insideOnBegin<override>()<suspends>:void. That method runs automatically when the experience begins. - It's also a real object in the world. Because a
creative_devicehas a transform, it can move itself around the map. You canTeleportToit instantly,MoveToit smoothly over time, orShow/Hideit.
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 fromcreative_device, so UEFN shows this in the content browser and gives usOnBegin,MoveTo,TeleportTo,Show, andHide.@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— plainvector3values (positions in centimeters). Note we use0.0, not0— 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, ...]):—TeleportTois<decides>, meaning it can fail, so it's called with square brackets inside anif. This instantly places the device.StartTrigger.TriggeredEvent.Subscribe(OnTriggered)— we subscribe a method to the trigger's event. Always subscribe insideOnBegin.OnTriggered(Agent : ?agent)— the handler. The trigger hands an optional agent. Wespawnthe raising sequence so the handler doesn't block.RaisePlatform()<suspends>— a coroutine.Show()reveals the device, thenMoveTo(...)smoothly animates it toHighPositionover3.0seconds 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 ifSomeTriggeris an@editablefield on yourcreative_device. A bare reference to a level device gives 'Unknown identifier'. TeleportTois<decides>,MoveTois<suspends>. CallTeleportTowith square brackets inside anif(it can fail). CallMoveTofrom a<suspends>context (likeOnBeginor aspawned coroutine) — you can't call it from a plainvoidmethod.- Don't block your event handlers.
MoveTotakes real time. If you call a multi-second move directly inside a non-suspending handler it won't compile; wrap it inspawn{ ... }and put the move in a separate<suspends>method. - int vs float. Positions are
vector3of floats andMoveTo'sOverTimeis afloat. Always write3.0, never3. Verse will not convert for you. ?agentvsagent.trigger_device.TriggeredEventhands a?agent(optional) whilebutton_device.InteractedWithEventhands anagent. Unwrap an optional withif (A := Agent?):before using it.Hidedisables collision. A hiddencreative_device(orcreative_prop) won't be steppable or shootable. CallShowbefore players are meant to interact with it.OnEndcoroutines may not run. The docs note coroutines spawned insideOnEndmay never execute, so don't rely on long-running cleanup there.