Reference Devices compiles

input_trigger_device: React to Player Button Presses in Verse

The `input_trigger_device` lets your Verse code react the moment a player presses or releases a custom input action — think charge attacks, held-beam weapons, or a vault door that only opens while a button is held. Unlike a floor trigger that fires when someone walks over it, this device gives you both a press event and a release event that carries exactly how long the input was held. Pair it with a `trigger_device` to broadcast those moments to the rest of your device graph.

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

Overview

The input_trigger_device listens for a single configurable player input (set in the device's Input option in the UEFN editor) and surfaces two Verse events:

  • PressedEvent — fires the instant the player presses the bound key/button, sending the agent who pressed it.
  • ReleasedEvent — fires when the player lets go, sending a tuple(agent, float) where the float is the hold duration in seconds.

Common use cases:

  • A charge-shot mechanic — start charging on press, fire on release with damage scaled to hold time.
  • A held-door — a vault door that stays open only while the player holds the input.
  • A timed puzzle — players must hold a button for exactly N seconds to unlock the next room.
  • A sprint toggle — register/unregister players dynamically to gate who can use the input.

The device also exposes Enable/Disable so you can turn input listening on and off from Verse, and Register/Unregister/UnregisterAll to control which players the device responds to (depending on the Registered Player Behavior setting in the editor). The IsHeld failable method lets you poll whether an agent is currently holding the input at any point in your logic.

API Reference

input_trigger_device

Used to listen for the player activating or releasing certain inputs. The input is defined by the Input option. Players can configure the key for the input in the Creative Input Actions section of the Keyboard Settings.

Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse).

input_trigger_device<public> := class<concrete><final>(creative_device_base):

Events (subscribe a handler to react):

Event Signature Description
PressedEvent PressedEvent<public>:listenable(agent) Signaled when the tracked input is pressed by an agent. Sends the agent that pressed the input.
ReleasedEvent ReleasedEvent<public>:listenable(tuple(agent, float)) Signaled when the tracked input is released by an agent. Sends the agent that released the input. Sends the float duration that the input was held.

Methods (call these to make the device act):

Method Signature Description
Enable Enable<public>():void Enables this device. An Input Trigger will listen for inputs from players that meet the device requirements.
Disable Disable<public>():void Disables this device. A disabled Input Trigger will not listen for inputs and will never show on the HUD.
Register Register<public>(Agent:agent):void Adds Agent to the registered player list. Registered Player Behavior determines whether registered players meet the device requirements.
Unregister Unregister<public>(Agent:agent):void Removes Agent from the registered player list. Registered Player Behavior determines whether registered players meet the device requirements.
UnregisterAll UnregisterAll<public>():void Clears the list of registered players. Registered Player Behavior determines whether registered players meet the device requirements.
IsHeld IsHeld<public>(Agent:agent)<transacts><decides>:void Succeeds if Agent is currently holding the input.

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.

Walkthrough

Scenario: A Charge-Shot Vault Door

A player walks up to a locked vault. They hold a custom input to charge the door mechanism; when they release after at least 2 seconds, the vault opens (a trigger_device fires to activate linked barrier/prop devices). If they release too early, nothing happens. The input is disabled after a successful open so it can't be spammed.

Editor setup:

  1. Place an input_trigger_device — set Input to your custom action (e.g. PrimaryAction).
  2. Place a trigger_device — link it to whatever barrier/prop you want to open.
  3. Place a verse_device referencing both.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Playspaces }

# charge_vault_device — opens a vault door when the player holds the input for 2+ seconds.
charge_vault_device := class(creative_device):

    # Wire up in the UEFN editor
    @editable
    InputTrigger : input_trigger_device = input_trigger_device{}

    @editable
    VaultTrigger : trigger_device = trigger_device{}

    # Minimum hold time in seconds required to open the vault
    MinHoldSeconds : float = 2.0

    # Track whether the vault has already been opened
    var VaultOpened : logic = false

    OnBegin<override>()<suspends> : void =
        # Make sure the input device is active at game start
        InputTrigger.Enable()

        # Subscribe to press and release events
        InputTrigger.PressedEvent.Subscribe(OnInputPressed)
        InputTrigger.ReleasedEvent.Subscribe(OnInputReleased)

    # Called the moment a player presses the input
    OnInputPressed(Agent : agent) : void =
        # Nothing to do on press for this mechanic — we wait for release
        # But you could start a VFX or sound here via other linked devices
        set VaultOpened = false  # reset in case of retry

    # Called when the player releases the input; tuple carries (agent, hold_duration)
    OnInputReleased(Payload : tuple(agent, float)) : void =
        # Destructure the tuple
        Agent := Payload(0)
        HoldDuration := Payload(1)

        # Only open if held long enough and not already open
        if (HoldDuration >= MinHoldSeconds, VaultOpened = false):
            set VaultOpened = true
            # Fire the vault trigger with the agent who opened it
            VaultTrigger.Trigger(Agent)
            # Disable the input so it can't be triggered again
            InputTrigger.Disable()

Line-by-line breakdown:

Lines What's happening
@editable fields Lets you wire InputTrigger and VaultTrigger in the UEFN editor without hard-coding device references.
InputTrigger.Enable() Ensures the device is listening at game start (it may be disabled by default in the editor).
InputTrigger.PressedEvent.Subscribe(OnInputPressed) Registers OnInputPressed as the handler; it receives the agent who pressed.
InputTrigger.ReleasedEvent.Subscribe(OnInputReleased) Registers OnInputReleased; the handler receives tuple(agent, float).
Payload(0) / Payload(1) Tuple indexing — (0) is the agent, (1) is the float hold duration.
HoldDuration >= MinHoldSeconds Guard: only proceed if held for 2+ seconds.
VaultTrigger.Trigger(Agent) Fires the trigger device with the specific agent, activating linked barriers/props.
InputTrigger.Disable() Prevents repeated opens once the vault is unlocked.

Common patterns

Pattern 1: IsHeld polling — a beam that deals damage only while held

Use IsHeld (a failable/<decides> method) inside a loop to continuously check whether a player is holding the input, enabling tick-style logic.

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

# held_beam_device — activates a linked trigger every second while the player holds the input.
held_beam_device := class(creative_device):

    @editable
    InputTrigger : input_trigger_device = input_trigger_device{}

    @editable
    BeamEffectTrigger : trigger_device = trigger_device{}

    OnBegin<override>()<suspends> : void =
        InputTrigger.Enable()
        InputTrigger.PressedEvent.Subscribe(OnBeamPressed)

    OnBeamPressed(Agent : agent) : void =
        # Spawn an async task so the main flow isn't blocked
        spawn { BeamLoop(Agent) }

    # Loops every 0.5s while the agent holds the input, firing the beam trigger
    BeamLoop(Agent : agent)<suspends> : void =
        loop:
            Sleep(0.5)
            # IsHeld is <decides> — use it inside an `if` to check hold state
            if (InputTrigger.IsHeld[Agent]):
                BeamEffectTrigger.Trigger(Agent)
            else:
                break  # player released — stop the loop

Key point: IsHeld is marked <transacts><decides> — it only succeeds (doesn't return a bool). Use it inside an if or if (InputTrigger.IsHeld[Agent]): guard. Square brackets [] are the Verse syntax for calling a failable expression.


Pattern 2: Register/Unregister — only the puzzle-solver can use the input

Dynamically control which players the input device responds to using Register and Unregister. Useful for single-player puzzle segments in a multiplayer map.

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

# puzzle_gate_device — only the player who steps on a pressure plate can use the input.
puzzle_gate_device := class(creative_device):

    @editable
    InputTrigger : input_trigger_device = input_trigger_device{}

    @editable
    PressurePlate : trigger_device = trigger_device{}

    @editable
    PuzzleSolveTrigger : trigger_device = trigger_device{}

    OnBegin<override>()<suspends> : void =
        # Start with no registered players — nobody can use the input yet
        InputTrigger.UnregisterAll()
        InputTrigger.Enable()

        PressurePlate.TriggeredEvent.Subscribe(OnPlateTriggered)
        InputTrigger.PressedEvent.Subscribe(OnPuzzleInputPressed)

    # When a player steps on the plate, register them so they can use the input
    OnPlateTriggered(MaybeAgent : ?agent) : void =
        if (Agent := MaybeAgent?):
            InputTrigger.Register(Agent)

    # When the registered player presses the input, solve the puzzle
    OnPuzzleInputPressed(Agent : agent) : void =
        PuzzleSolveTrigger.Trigger(Agent)
        # Unregister them so the input won't fire again for this player
        InputTrigger.Unregister(Agent)

Key point: trigger_device.TriggeredEvent sends ?agent (optional agent). Always unwrap with if (Agent := MaybeAgent?): before using the agent.


Pattern 3: Enable/Disable with trigger_device SetMaxTriggerCount — a one-time alarm

Combine input_trigger_device.Disable() with trigger_device.SetMaxTriggerCount to create a one-shot alarm that can only be triggered once per round.

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

# alarm_device — player presses input once to trigger a one-shot alarm; input locks out after.
alarm_device := class(creative_device):

    @editable
    InputTrigger : input_trigger_device = input_trigger_device{}

    @editable
    AlarmTrigger : trigger_device = trigger_device{}

    OnBegin<override>()<suspends> : void =
        # Limit the alarm trigger to fire only once
        AlarmTrigger.SetMaxTriggerCount(1)
        InputTrigger.Enable()
        InputTrigger.PressedEvent.Subscribe(OnAlarmPressed)

    OnAlarmPressed(Agent : agent) : void =
        # Check how many triggers remain before firing
        Remaining := AlarmTrigger.GetTriggerCountRemaining()
        if (Remaining > 0):
            AlarmTrigger.Trigger(Agent)
            # Disable the input so no other player can trigger it
            InputTrigger.Disable()

Key point: GetTriggerCountRemaining() returns 0 when GetMaxTriggerCount() is unlimited (set to 0). Here we set it to 1 so the guard Remaining > 0 correctly allows exactly one fire.

Gotchas

1. ReleasedEvent sends a tuple, not just an agent

The handler signature for ReleasedEvent must accept tuple(agent, float), not just agent. A common mistake is writing OnReleased(Agent : agent) — this will fail to compile or silently never match.

# WRONG — mismatched handler signature
OnInputReleased(Agent : agent) : void = ...

# CORRECT — destructure the tuple
OnInputReleased(Payload : tuple(agent, float)) : void =
    Agent := Payload(0)
    HoldDuration := Payload(1)

2. IsHeld is failable — use if, not a direct call

IsHeld is marked <decides> meaning it either succeeds or fails; it doesn't return a logic value. You must call it inside a decision context:

# WRONG — IsHeld is not a bool-returning function
if (InputTrigger.IsHeld(Agent) = true):

# CORRECT — failable call uses square brackets inside if
if (InputTrigger.IsHeld[Agent]):

3. trigger_device.TriggeredEvent sends ?agent, not agent

When you subscribe to trigger_device.TriggeredEvent, the handler receives an optional agent (?agent). Always unwrap it:

OnTriggered(MaybeAgent : ?agent) : void =
    if (Agent := MaybeAgent?):
        # safe to use Agent here

4. Register/Unregister only matter when Registered Player Behavior is configured

In the UEFN editor, the input_trigger_device has a Registered Player Behavior property. If it's set to Ignore Registered Players (the default), calling Register has no effect. Set it to Only Registered Players or Exclude Registered Players to make the register list meaningful.

5. Forgetting to call Enable() at game start

If the device's Enabled on Game Start editor property is false, the device won't fire any events until you call InputTrigger.Enable() in Verse. Always call Enable() in OnBegin if you want it active from the start.

6. int vs float — no auto-conversion

SetMaxTriggerCount takes an int; SetResetDelay/SetTransmitDelay take a float. Verse does not auto-convert. Write 2.0 not 2 for float parameters, and 1 not 1.0 for int parameters.

7. @editable fields are mandatory for device references

You cannot write input_trigger_device{} and call methods on a bare local — the device must be declared as an @editable field on your creative_device class so UEFN wires it to the actual placed device in the level.

Device Settings & Options

The input_trigger_device User Options panel in the UEFN editor — every setting you can tune.

Input Trigger Device settings and options panel in the UEFN editor
Input Trigger Device — User Options in the UEFN editor

Guides & scripts that use input_trigger_device

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

Build your own lesson with input_trigger_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 →