Skip to main content

UI Widgets

The plugin provides a hierarchy of UMG widget base classes. All interaction UI should inherit from these to get automatic delegate binding and easy Blueprint override points.


UGameplayInteractionWidget

The base class for all interaction widgets. It holds a reference to UGameplayInteractionComponent and binds / unbinds from all of its delegates automatically.

Registering the Component

// Call this after the HUD is created and the player controller is valid
Widget->RegisterInteractionComponent(PlayerController->GetInteractionComponent());

Or in Blueprint:

Self → Register Interaction Component → PlayerController.GetInteractionComponent()

To detach (e.g. when the HUD is destroyed):

Self → Unregister Interaction Component

Blueprint Override Events

EventParametersPurpose
OnEntityInViewChangedEntity, LastObservedEntityShow / hide the widget when a new entity enters or leaves view
OnSelectedInteractionOptionChangedSelectedOptionUpdate the displayed action name and icon
OnInteractionStartedEntityPlayer began interacting — e.g. lock input display
OnInteractionFinishedEntityInteraction ended normally
OnInteractionStateChangedEntityEntity state changed mid-interaction (another player started/finished)
OnTimedInteractionStartedInteractionTimeA timed hold began — start a progress bar
OnTimedInteractionFinishedbWasCancelledHold ended — reset the progress bar
OnEntityDynamicTagsChangedEntity tags updated — refresh availability display
OnInteractionErrorErrorEntryShow an error message (check ErrorEntry.bIsSilent first)
OnInteractionErrorClearedHide the error message
OnInteractionTerminatedEntityAn external system terminated the interaction

Useful Accessors

FunctionReturns
GetPlayerInteractionComponent()The bound interaction component
GetInteractiveEntityInView()Entity currently in the player's crosshair
GetCachedInteractiveEntityFromInteraction()Entity snapshotted at the moment the interact input was pressed
GetAbilitySystemComponent()The local player's ASC (via IAbilitySystemInterface on the owning controller)

UGameplayTimedInteractionWidget

Extends UGameplayInteractionWidget with a tick-driven progress update loop for timed hold interactions.

How It Works

When OnTimedInteractionStarted fires, it starts an internal timer that ticks at TimerTickRate (default 0.25 s). Each tick it calculates the normalised progress and calls BP_OnProgressUpdate(Percent). When OnTimedInteractionFinished fires it clears the timer and resets to 0.

Configuration

PropertyDefaultDescription
TimerTickRate0.25How often the progress event fires (seconds). Lower = smoother bar, higher CPU tick cost.

Blueprint Override

EventParametersPurpose
BP_OnProgressUpdatePercent (0.0–1.0)Drive a progress bar, ring fill, or animation curve

Example Widget Setup

  1. Create a Blueprint inheriting GameplayTimedInteractionWidget.
  2. Add a ProgressBar widget to the hierarchy.
  3. Override BP_OnProgressUpdate → set the progress bar's percent to the Percent parameter.
  4. Override OnTimedInteractionStarted → make the widget visible.
  5. Override OnTimedInteractionFinished → hide the widget.

UGameplayInteractionRadialMenuWidget (NOT IMPLEMENTED YET)

A radial slice selector for displaying and picking between multiple interaction options. Hover detection runs in NativeTick using the mouse position relative to the widget's center.

Configuration (Class Defaults)

PropertyDefaultDescription
NumSlices6Total number of slices rendered
SpacingDegrees6.0Angular gap between adjacent slices
InnerRadiusRatio0.3Inner dead zone as a fraction of the widget's radius
ImageSize512Reference size of the slice image canvas (assumes square)
DeadZone0.0Extra dead zone radius around center to prevent accidental selection

Blueprint Override Events

EventParametersPurpose
GetSlicesWidgetsMust override. Return the array of slice widget references from your Widget Hierarchy
BP_OnUpdateInnerCircleInfoOptionInfoCalled when the hovered slice changes — update the inner circle label/icon

Setup Steps

  1. Create a Blueprint inheriting GameplayInteractionRadialMenuWidget.
  2. Build your widget hierarchy: a Canvas Panel at root, one UGameplayInteractionRadialMenuSliceWidget per slice.
  3. Override GetSlicesWidgets to return the array of slice widget references.
  4. In NativeOnInitialized (handled by the base class), SliceAngle and cached geometry are initialised automatically.
  5. Populate each slice with SetInteractionOptionInfo(Option) when the radial menu opens, using the options from PlayerInteractionComponent->AvailableOptions.

UGameplayInteractionRadialMenuSliceWidget (NOT IMPLEMENTED YET)

Represents a single slice in the radial menu. Handles hover, unhover, mouse down, mouse up, and selection states.

Key Functions

FunctionDescription
InitializeSlice(Index, NumSlices, SpacingDegrees, InnerRatio, ImageSize, IconSize, LockIconSize)Sets geometry and computes the icon position on the canvas
SetInteractionOptionInfo(Option)Stores the option reference and fires BP_OnInteractionOptionInfoSet
SetHovered(bHovered)Called by the parent radial menu; fires hover/unhover events

Blueprint Override Events

EventPurpose
GetIconImageMust override. Return the UImage widget to position as the action icon
GetLockIconImageMust override. Return the UImage widget for the locked/unavailable icon
BP_OnInteractionOptionInfoSetUpdate icon, label, and availability display from InteractionOptionInfo
BP_OnSliceHoveredHighlight the slice
BP_OnSliceUnhoveredRemove highlight
BP_OnSliceMouseDownButton down visual
BP_OnSliceMouseUpButton up visual
BP_OnSliceSelectedConfirmed selection — call PlayerInteractionComponent->PlayerSelectInteractionOption(InteractionOptionInfo) here

Icon Positioning

InitializeSlice automatically computes the icon's canvas position at the midpoint of the slice arc (between inner and outer radius). It uses the IconSize vector to centre the image. The lock icon is overlaid at LockIconSize. Call InitializeSlice from the parent radial menu after building the slice list.


Wiring the Radial Menu

A typical radial menu flow in Blueprint:

[Input: Show Options pressed]
→ Show RadialMenu widget
→ For each Option in InteractionComponent.AvailableOptions:
SlicesWidgets[i].SetInteractionOptionInfo(Option)
SlicesWidgets[i].InitializeSlice(i, NumOptions, ...)
→ Set mouse cursor visible

[Slice BP_OnSliceSelected]
→ InteractionComponent.PlayerSelectInteractionOption(InteractionOptionInfo)
→ Hide RadialMenu widget
→ Set mouse cursor hidden