Skip to main content

UI

EDInteractionSystem is designed to work well with Unreal's UI framework.

The plugin provides:

  • UEDInteractionWidget: a base widget class with interaction state and Blueprint events.

This design allows you to build a single generic interaction widget and update it as the player focuses different interactables.

Core idea

The interaction UI is driven by a plain struct stored inside the widget:

  • UEDInteractionWidget::InteractionState (FEDInteractionWidgetState)

The player component updates that state using a small set of BlueprintNativeEvent “master” methods (so Blueprints can react if needed):

  • UpdateUIInteractionInfoMaster(...)
  • UpdateHitPointsMaster(...)
  • UpdateCooldownInfoMaster(...)
  • SetInteractionPercentMaster(...)
  1. Create a Widget Blueprint derived from UEDInteractionWidget.
  2. Use InteractionState to drive your UI.
  3. Decide how you want to update UI visuals:
    • Binding approach: bind Text/ProgressBar widgets directly to fields in InteractionState.
    • Event-driven approach: implement the master methods (Blueprint override) and set widget visuals there.

If you want an event-driven UI, the typical pattern is:

  • Override UpdateUIInteractionInfoMaster to set title/description/tag widgets.
  • Override UpdateHitPointsMaster to update HP widgets.
  • Override UpdateCooldownInfoMaster to update cooldown widgets.
  • Override SetInteractionPercentMaster to update hold progress widgets.

Where does the data come from?

At runtime, UEDPlayerInteractionComponent drives the UI:

  • On focus change, it ensures a widget instance exists (based on FEDWidgetInfo::InteractionWidgetClass).
  • It assigns InteractableComponent via SetInteractableComponent(...).
  • It writes the current focus information into InteractionState via the master methods.
  • Over time, it keeps updating progress/cooldown while the player is focusing and/or interacting.