Skip to main content

Widget + State

What you build​

You create a Widget Blueprint derived from:

  • UEDInteractionWidget

The widget contains:

  • InteractionState (FEDInteractionWidgetState) as a regular BlueprintReadWrite struct
  • InteractableComponent (optional) for direct access to the focused actor component

FEDInteractionWidgetState​

The state struct is intended to be the single source of truth for what the UI should display.

Common fields:

  • UI text: Title, Description, FocusTag
  • Method: InteractionMethod
  • Hold progress: InteractionPercent
  • HitPoints: CurrentHealth, MaxHealth
  • Cooldown: CooldownTotal, CooldownRemaining, CooldownPercent
  • Co-op: MinPlayersRequired, MaxPlayersAllowed, CurrentInteractors, MultiplayerSpeedMultiplier
  • Extra: InteractDuration, ButtonMashingCountNeeded
  • Deny: bIsInteractionDenied

How the state is written​

UEDPlayerInteractionComponent owns the flow and updates the widget through “master” methods (BlueprintNativeEvent):

  • UpdateUIInteractionInfoMaster(EEDInteractionMethod, const FEDWidgetInfo&)
  • UpdateHitPointsMaster(float CurrentHitPoints, float MaxHitPoints, bool bUpdate)
  • UpdateCooldownInfoMaster(float CooldownRemaining, float CooldownTotal, float CooldownPercent)
  • SetInteractionPercentMaster(float Percent)
  • UpdateMultiplayerInfoMaster(int32 MinPlayersRequired, int32 MaxPlayersAllowed, int32 CurrentInteractors, float SpeedMultiplier)
  • UpdateIsInteractionDeniedMaster(bool bIsDenied)

Those native implementations update InteractionState directly.

How you update visuals in Blueprints​

You can choose one of two patterns:

A) Bind widgets to InteractionState​

  • Bind Text widgets to InteractionState.Title / Description / FocusTag
  • Bind ProgressBars to InteractionState.InteractionPercent / CooldownPercent

This is the simplest to set up.

B) Override the master methods (event-driven UI)​

Implement (override) the master functions in your Widget Blueprint and update your widget visuals there.

Typical mapping:

  • UpdateUIInteractionInfoMaster: Title/Description/FocusTag widgets
  • UpdateHitPointsMaster: HP bar and HP text
  • UpdateCooldownInfoMaster: cooldown visuals
  • SetInteractionPercentMaster: hold interaction progress

Widget lifecycle events​

These Blueprint events are useful for animations and transient feedback:

  • PlayShowAnimationMaster()
  • PlayDenyAnimation()
  • OnInteractionWidgetShown()
  • OnInteractionWidgetHidden()
  • OnInteractionDenied(...)
  • OnInteractionCompleted(...)
  • OnInteractAfterDurationStarted(...)
  • OnInteractAfterDurationStopped(...)