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(...)
Recommended Blueprint workflow
- Create a Widget Blueprint derived from
UEDInteractionWidget. - Use
InteractionStateto drive your UI. - 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.
- Binding approach: bind Text/ProgressBar widgets directly to fields in
If you want an event-driven UI, the typical pattern is:
- Override
UpdateUIInteractionInfoMasterto set title/description/tag widgets. - Override
UpdateHitPointsMasterto update HP widgets. - Override
UpdateCooldownInfoMasterto update cooldown widgets. - Override
SetInteractionPercentMasterto 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
InteractableComponentviaSetInteractableComponent(...). - It writes the current focus information into
InteractionStatevia the master methods. - Over time, it keeps updating progress/cooldown while the player is focusing and/or interacting.