Goal
This recipe replaces the default prompt presentation with a project UMG widget while keeping runtime validation in the framework.
Create The Widget
- Create a widget Blueprint based on
UInteractionUIWidgetBase. - Add containers for command rows, control rows, progress, failure text, cooldown, route state, and projected positioning.
- Assign the widget class in UI developer settings or create it from your UI layer.
- Let
UInteractionUIManagerSubsystembind automatically for the local pawn path unless you have custom ownership.
Render Runtime State
- Use surface entry events to add, update, and remove command rows.
- Use control entry events for More, Back, and cancellation controls.
- Use projection events to move or clamp the widget.
- Use progress and outcome events for hold, multi-tap, cooldown, and route feedback.
- Use
UInteractionRuntimeWidgetPayloadfor project-specific icons, labels, colors, or layout mode.
Verification
Test focus enter, focus switch, focus exit, command activation, blocked command, cooldown, paging, progress, and payload changes. The widget should update without requiring direct reads from the target definition asset.
Row Lifecycle
Create row widgets when entries are added, update them when entries change, and remove them when entries are removed. Keep a row map keyed by runtime entry identity or surface index. Avoid rebuilding the entire prompt on every tick unless the UI is intentionally simple and low-frequency.
Projection Lifecycle
Projection can change even when the command surface does not. Move the prompt container on projection updates and update row content on surface updates. This keeps UI smooth when the player camera moves without unnecessarily rebuilding command rows.
Failure Diagnosis
- Widget shows but rows are empty: surface events are not handled or current surface has no entries.
- Rows show wrong input: widget uses hard-coded keys instead of prompt/control entry data.
- Widget stays on screen after focus ends: release or clear events are not handled.
- Payload cast fails: target definition uses a different payload class than the widget expects.
Accessibility And Readability
Prompt widgets should keep command text, input text, cooldown values, progress values, and participant counts readable under movement and camera changes. Avoid layouts where long command names cover input labels or progress bars. Clamp and alignment data should help the prompt stay usable at viewport edges.
Integration With Project UI
If the project has its own HUD manager, let that manager own widget creation while still feeding the widget runtime data from UInteractionUIManagerSubsystem or the interactor. Keep the framework widget base as the adapter between runtime state and project UI style.
Recommended Widget Structure
- Root prompt container positioned from projection data.
- Command row container keyed by runtime surface entries.
- Control row container for paging and cancel controls.
- Status area for failure text, cooldown, progress, participant count, and route stage.
- Payload-driven area for project icons, colors, or labels.
State Reset Rules
Clear command rows when the surface ends. Clear progress when the command completes, cancels, or focus changes. Clear payload-specific visuals when payload changes to null or to a different payload class. Reset projection offsets when the focused point changes.
Project UI Integration
If a project HUD already controls widget lifetime, let it create the widget and still use UInteractionUIWidgetBase as the runtime state receiver. If the framework UI manager owns the widget, keep custom HUD code out of the prompt lifecycle and style the widget itself.