Overview
The transform struct is Verse's all-in-one snapshot of an object's Translation (position), Rotation, and Scale in world space. You get one by calling GetTransform() on anything that implements the positional interface — including fort_character, creative_prop, and several devices.
On a sun-drenched pirate cove island you might need to:
- Know where a player is standing so you can check if they've reached the dock.
- Read a character's view location to aim a cannon.
- Teleport a prop to the exact spot a player is standing.
- Fire a
trigger_devicesignal only when a player is close enough to a treasure chest.
Reach for GetTransform() any time your logic depends on where something is rather than what it did.
API Reference
transform
A combination of scale, rotation, and translation, applied in that order.
Full public surface, resolved verbatim from the live Epic digest (Verse.digest.verse).
transform<native><public> := struct<concrete><computes>:
trigger_device
Used to relay events to other linked devices.
Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse). Inherited members are merged from trigger_base_device.
trigger_device<public> := class<concrete><final>(trigger_base_device):
Events (subscribe a handler to react):
| Event | Signature | Description |
|---|---|---|
TriggeredEvent |
TriggeredEvent<public>:listenable(?agent) |
Signaled when an agent triggers this device. Sends the agent that used this device. Returns false if no agent triggered the action (ex: it was triggered through code). |
Methods (call these to make the device act):
| Method | Signature | Description |
|---|---|---|
Trigger |
Trigger<public>(Agent:agent):void |
Triggers this device with Agent being passed as the agent that triggered the action. Use an agent reference when this device is setup to require one (for instance, you want to trigger the device only with a particular agent. |
Trigger |
Trigger<public>():void |
Triggers this device, causing it to activate its TriggeredEvent event. |
Enable |
Enable<public>():void |
Enables this device. |
Disable |
Disable<public>():void |
Disables this device. |
SetMaxTriggerCount |
SetMaxTriggerCount<public>(MaxCount:int):void |
Sets the maximum amount of times this device can trigger. * 0 can be used to indicate no limit on trigger count. * MaxCount is clamped between [0,20]. |
GetMaxTriggerCount |
GetMaxTriggerCount<public>()<transacts>:int |
Gets the maximum amount of times this device can trigger. * 0 indicates no limit on trigger count. |
GetTriggerCountRemaining |
GetTriggerCountRemaining<public>()<transacts>:int |
Returns the number of times that this device can still be triggered before hitting GetMaxTriggerCount. Returns 0 if GetMaxTriggerCount is unlimited. |
SetResetDelay |
SetResetDelay<public>(Time:float):void |
Sets the time (in seconds) after triggering, before the device can be triggered again (if MaxTrigger count allows). |
GetResetDelay |
GetResetDelay<public>()<transacts>:float |
Gets the time (in seconds) before the device can be triggered again (if MaxTrigger count allows). |
SetTransmitDelay |
SetTransmitDelay<public>(Time:float):void |
Sets the time (in seconds) which must pass after triggering, before this device informs other external devices that it has been triggered. |
GetTransmitDelay |
GetTransmitDelay<public>()<transacts>:float |
Gets the time (in seconds) which must pass after triggering, before this device informs other external devices that it has been triggered. |
player
Full public surface, resolved verbatim from the live Epic digest (Verse.digest.verse). Inherited members are merged from agent.
player<native><public> := class<unique><persistent><module_scoped_var_weak_map_key><epic_internal>(agent):
Walkthrough
Scenario — The Cove Checkpoint
Your 2-D cel-shaded island has a sunny lagoon with a wooden dock. A trigger_device (the DockFlare) fires a signal flare animation when a pirate steps onto the pressure plate at the end of the dock. But you only want the flare to fire if the player is actually close to the dock's anchor prop — not if the trigger was tripped by a stray cannonball. The Verse device below:
- Subscribes to the trigger's
TriggeredEvent. - In the handler, gets the triggering player's
fort_characterand callsGetTransform()to read their world position. - Computes a rough distance check against the dock anchor's transform.
- Only calls
DockFlare.Trigger(Agent)— the real device method — if the player is close enough. - After firing, calls
DockFlare.SetMaxTriggerCount(1)so the flare only ever fires once per round.
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/SpatialMath }
# Place this device in your cove level.
# Wire DockPlate → this device's DockPlate field,
# DockFlare → this device's DockFlare field,
# and DockAnchorProp → this device's DockAnchorProp field.
cove_checkpoint_device<public> := class<concrete>(creative_device):
# The pressure plate at the end of the dock the player walks onto.
@editable
DockPlate : trigger_device = trigger_device{}
# The trigger_device that fires the signal-flare VFX/audio.
@editable
DockFlare : trigger_device = trigger_device{}
# A prop placed at the dock anchor — we read its transform as the
# "dock centre" reference point.
@editable
DockAnchorProp : creative_prop = creative_prop{}
# How close (in Unreal units, ~cm) the player must be to the anchor.
@editable
ProximityThreshold : float = 300.0
OnBegin<override>()<suspends> : void =
# Limit the flare to one fire per round, then subscribe.
DockFlare.SetMaxTriggerCount(1)
DockPlate.TriggeredEvent.Subscribe(OnDockPlateTriggered)
# Called whenever a player (or code) trips the dock pressure plate.
OnDockPlateTriggered(MaybeAgent : ?agent) : void =
if (Agent := MaybeAgent?):
# Cast agent → fort_character to access GetTransform.
if (Character := Agent.GetFortCharacter[]):
PlayerTransform := Character.GetTransform()
AnchorTransform := DockAnchorProp.GetTransform()
# Simple axis-aligned proximity check on XY plane.
Dx := PlayerTransform.Translation.X - AnchorTransform.Translation.X
Dy := PlayerTransform.Translation.Y - AnchorTransform.Translation.Y
DistSq := Dx * Dx + Dy * Dy
ThreshSq := ProximityThreshold * ProximityThreshold
if (DistSq <= ThreshSq):
# Player is on the dock — fire the flare with their agent.
DockFlare.Trigger(Agent)
Line-by-line explanation
| Lines | What's happening |
|---|---|
@editable DockPlate |
The pressure-plate trigger placed on the dock. |
@editable DockFlare |
The signal-flare trigger we fire programmatically. |
@editable DockAnchorProp |
A prop at the dock centre — its GetTransform() gives us the reference position. |
DockFlare.SetMaxTriggerCount(1) |
Caps the flare at one fire; 0 would mean unlimited. |
DockPlate.TriggeredEvent.Subscribe(OnDockPlateTriggered) |
Hooks our handler to the plate event. |
MaybeAgent : ?agent |
TriggeredEvent sends ?agent — it can be false if code triggered it. |
Agent := MaybeAgent? |
Unwraps the option; skips the rest if no real agent. |
Character.GetTransform() |
Returns the player's current world transform (Translation, Rotation, Scale). |
DockAnchorProp.GetTransform() |
Returns the prop's world transform — our dock-centre reference. |
DistSq <= ThreshSq |
Squared-distance avoids a Sqrt call; purely integer-free float math. |
DockFlare.Trigger(Agent) |
Fires the flare device, passing the real agent so downstream devices know who triggered it. |
Common patterns
Pattern 1 — Read a player's view location to aim a cannon
Use GetViewLocation() (available on fort_character) alongside GetTransform() to find where a player is looking from — useful for a cove cannon that fires toward the player's aim point.
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/SpatialMath }
# Attach to a cannon trigger on your pirate ship.
# When a player activates the cannon trigger, we log their
# view location and world position via GetTransform.
cannon_aim_device<public> := class<concrete>(creative_device):
@editable
CannonTrigger : trigger_device = trigger_device{}
# A secondary trigger that fires the cannon VFX/sound.
@editable
CannonFireTrigger : trigger_device = trigger_device{}
OnBegin<override>()<suspends> : void =
CannonTrigger.Enable()
CannonTrigger.TriggeredEvent.Subscribe(OnCannonActivated)
OnCannonActivated(MaybeAgent : ?agent) : void =
if (Agent := MaybeAgent?):
if (Character := Agent.GetFortCharacter[]):
# Where the character's body is in the world.
BodyTransform := Character.GetTransform()
# Where their eyes / crosshair are aiming from.
ViewOrigin := Character.GetViewLocation()
# Only fire the cannon if the player is standing on the ground
# (not swimming off the cove dock).
if (Character.IsOnGround[]):
CannonFireTrigger.Trigger(Agent)
Pattern 2 — Disable a trigger after reading remaining count
Use GetTriggerCountRemaining() to decide whether to disable a treasure-chest trigger once it has been looted enough times.
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/SpatialMath }
# Treasure chest loot gate — disables itself after MaxLootings pickups.
treasure_loot_gate_device<public> := class<concrete>(creative_device):
@editable
ChestTrigger : trigger_device = trigger_device{}
@editable
MaxLootings : int = 3
OnBegin<override>()<suspends> : void =
ChestTrigger.SetMaxTriggerCount(MaxLootings)
ChestTrigger.SetResetDelay(5.0) # 5-second cooldown between lootings
ChestTrigger.TriggeredEvent.Subscribe(OnChestLooted)
OnChestLooted(MaybeAgent : ?agent) : void =
if (Agent := MaybeAgent?):
if (Character := Agent.GetFortCharacter[]):
# Read the player's world position for debug / analytics.
T := Character.GetTransform()
Remaining := ChestTrigger.GetTriggerCountRemaining()
# When no triggers remain, disable so it can't be code-triggered either.
if (Remaining = 0):
ChestTrigger.Disable()
Pattern 3 — Teleport a prop to a player's position using their transform
Read a player's GetTransform() and use its Translation and Rotation to teleport a loot-drop prop right to their feet when they step on a lagoon pad.
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/SpatialMath }
# Drop a supply crate at the player's feet when they step on the lagoon pad.
lagoon_drop_device<public> := class<concrete>(creative_device):
@editable
LagoonPad : trigger_device = trigger_device{}
@editable
SupplyCrateProp : creative_prop = creative_prop{}
OnBegin<override>()<suspends> : void =
LagoonPad.SetMaxTriggerCount(1) # One drop per round
LagoonPad.TriggeredEvent.Subscribe(OnPadTriggered)
OnPadTriggered(MaybeAgent : ?agent) : void =
if (Agent := MaybeAgent?):
if (Character := Agent.GetFortCharacter[]):
PlayerTransform := Character.GetTransform()
# Teleport the crate to the player's XY but keep Z the same as the prop.
CrateTransform := SupplyCrateProp.GetTransform()
DropPos := vector3:
X := PlayerTransform.Translation.X
Y := PlayerTransform.Translation.Y
Z := CrateTransform.Translation.Z
if (SupplyCrateProp.TeleportTo[DropPos, CrateTransform.Rotation]):
LagoonPad.Disable() # Prevent re-triggering after drop
Gotchas
1. GetTransform() is on positional, not agent
agent does not expose GetTransform() directly. You must cast to fort_character first:
if (Character := Agent.GetFortCharacter[]):
T := Character.GetTransform()
Skipping the cast will give you a compile error — agent has no GetTransform member.
2. TriggeredEvent sends ?agent, not agent
The event payload is an option type. Always unwrap it:
OnTriggered(MaybeAgent : ?agent) : void =
if (Agent := MaybeAgent?): # <- required unwrap
...
If you write (Agent : agent) the handler signature won't match and the subscription will silently fail or fail to compile.
3. transform.Translation is a vector3 of float — no int math
Verse does not auto-convert int to float. All arithmetic on Translation components must use float literals (e.g. 300.0, not 300).
4. SetMaxTriggerCount clamps to [0, 20]
Passing a value above 20 silently clamps to 20. Use 0 for unlimited. Check GetTriggerCountRemaining() — it returns 0 when the limit is unlimited, not when it's exhausted.
5. TeleportTo is failable (<decides>)
Always call it inside an if expression:
if (Prop.TeleportTo[Position, Rotation]):
# success
Calling it bare (outside if) is a compile error because <decides> functions must be in a failure context.
6. GetResetDelay / GetTransmitDelay return float seconds
These are read-back helpers — useful for logging or conditional logic, but they don't restart the timer. Call SetResetDelay before the first trigger fires to ensure the delay is in effect.