Master @editable Properties in Verse for UEFN Devices
Tutorial beginner

Master @editable Properties in Verse for UEFN Devices

Updated beginner

What you'll learn

In this guide you will learn how to:

  1. Use @editable to expose scalar values (float) and device/prop references to the UEFN Details panel.
  2. Read those exposed values safely inside your Verse script.
  3. Subscribe to a button's InteractedWithEvent and act on the exposed creative_prop when a player presses it.

How it works

A field declared inside a creative_device class is invisible in the editor by default. Adding the @editable attribute above the field tells UEFN to render it in the device's Details panel. There you can:

  • Swap targets: drag a button_device or a creative_prop from the level into the field slot.
  • Tweak numbers: change a float (delay, speed, count) without touching code or recompiling.

A few rules that keep this crash-free:

  • Always give every @editable field a default (= 2.0, = button_device{}). An unwired reference default is empty, so verify it before use.
  • Device references default to an empty device — calling into an unassigned device does nothing useful, so validate references with fallible checks like IsValid[] where the type supports it.
  • To actually do something, subscribe to a device event. Device events (like button_device.InteractedWithEvent) are subscribed WITHOUT parentheses: Button.InteractedWithEvent.Subscribe(Handler).

Let's build it

This device exposes three editable fields: a WaitTime delay, a TargetButton, and a TargetProp. On begin it waits WaitTime seconds, then listens for button presses. When a player interacts with the button, we grab the interacting agent and open/show the exposed prop for them.

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

# A device driven entirely by editor-exposed @editable properties.
editable_demo_device := class<concrete>(creative_device):

    # Expose a float delay (seconds) — tweakable in the Details panel.
    @editable
    WaitTime : float = 2.0

    # Expose a button reference — drag a Button Device into this slot.
    @editable
    TargetButton : button_device = button_device{}

    # Expose a prop reference — drag a Creative Prop into this slot.
    @editable
    TargetProp : creative_prop = creative_prop{}

    OnBegin<override>()<suspends>: void =
        # Read the editor-defined delay. Sleep is fallible-free but <suspends>.
        Sleep(WaitTime)

        # Confirm the prop reference is wired and valid before touching it.
        if (TargetProp.IsValid[]):
            Print("TargetProp is wired and valid.")
        else:
            Print("No valid TargetProp assigned in editor.")

        # Subscribe to the button's interaction event (device event: no parens).
        TargetButton.InteractedWithEvent.Subscribe(OnButtonPressed)
        Print("Listening for presses on TargetButton.")

    # Runs each time a player interacts with the exposed button.
    OnButtonPressed(Agent : agent) : void =
        Print("Button pressed — revealing the target prop!")
        # Only act if the exposed prop reference is valid.
        if (TargetProp.IsValid[]):
            # Show the prop in the world and enable its collision.
            TargetProp.Show()

Try it yourself

  1. Place this device in your level alongside a Button Device and a Creative Prop.
  2. Select the Verse device and open its Details panel.
  3. Change WaitTime to 5.0.
  4. Drag your Button Device into the TargetButton slot and your prop into the TargetProp slot.
  5. Push changes, launch the session, and press the button — the prop appears for the interacting player.

Recap

  • @editable exposes a class field to the UEFN Details panel.
  • You can expose primitives (float, int, logic) and references (button_device, creative_prop).
  • Always provide a default; references default to an empty device you must validate (e.g. IsValid[] inside an if).
  • Subscribe to device events without parentheses (Button.InteractedWithEvent.Subscribe(Handler)) to make the exposed device actually do work.
  • Read editable values just like normal fields inside OnBegin and your handlers.

Check your understanding

Test yourself with an interactive quiz and track your progress + earn XP — free for members.

Turn this into a guided course

Add Exposing Device Properties with @editable in Verse to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.

Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in