AFM_WidgetInteraction
Wraps Unreal's widget interaction with pointer index management, a cursor and a laser material, so several pointers can drive UMG at once.
What it gives you
- Multiple simultaneous UMG pointers
- A themed cursor and beam
- Scroll and press forwarding from any ability
Required by
Description
Unreal's widget interaction component assumes one pointer. In VR there are at least two hands, and in
multiplayer several players may drive the same replicated UI. AFM_WidgetInteraction adds pointer
index management so each pointer gets a unique index and they do not interfere.
BP_Helper_WidgetInteraction provides the visible cursor and beam, and forwards presses, releases
and scroll input attributed to the Source Info that triggered them.
Setup
- Add
BPC_WidgetInteractionto the ability that should drive UI, or use the helper actor. - Set Trace Distance and Auto Press On Contact to suit pointing or direct touch.
Usage
Pointing at UI
Pair with the laser ability. The laser supplies direction; this component supplies the UMG events.
Touching UI directly
Set Auto Press On Contact true for finger-touch UI, so no button press is required.
Getting a pointer index
Call WidgetInteraction_GetFreePointerIndex once per pointer.

Key properties
| Property | When to change |
|---|---|
Trace Distance | Pointer reach |
Auto Press On Contact | Direct-touch UI rather than pointing |
Sound Press | Feedback on press |
Extending
Derive from BP_Helper_WidgetInteraction for a custom cursor or beam.
Example map
Used throughout Map_Examples_UI.
Troubleshooting
Two pointers fight over the same widget. Both are using the same pointer index — obtain each from WidgetInteraction_GetFreePointerIndex.
API reference
Every blueprint asset in this module. Expand an asset to see its members.
Components
BPC_WidgetInteraction10 members
Component giving its owner a UMG pointer of its own: while active it spawns the widget interaction helper, which draws the beam and the cursor and forwards presses, releases and scrolling to whatever widget the trace lands on. Add it to an actor that has to work widgets without being a motion controller; the laser and the hand abilities carry their own instead.
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | Trace DistanceSettings | float | How far the pointer reaches when looking for a widget to interact with. |
| var | Auto Press on ContactSettings | bool | Presses automatically when the pointer touches a widget, instead of waiting for an input. Use for direct-touch UI. |
| var | Sound PressSound | SoundBase | Sound played when the pointer presses a widget. |
| fn | UpdateSourceInfoSource Info | (SourceInfo: ST_SourceInfo) | Records which ability is driving this pointer, so the widget can tell which hand or player is interacting. |
| fn | ScrollInputInput | (ScrollDelta: float) | Sends a scroll wheel delta to the hovered widget. |
| fn | PressMouseButtonInput | () | Presses the simulated mouse button on the hovered widget. |
| fn | ReleaseMouseButtonInput | () | Releases the simulated mouse button on the hovered widget. |
| fn | IsHoveringWidgetState | (out HoveringWidget: bool) | Returns whether the pointer is currently over an interactive widget. |
| event | UpdateColor | (Color: LinearColor) | Changes the pointer and cursor colour, for example to match the current interaction state. |
| event | OnWidgetHoveredChanged_Event | () | Internal handler fired when the hovered widget changes. |
Helper
BP_Helper_WidgetInteraction13 members
World-side actor driving a UMG widget from a trace: it owns the widget interaction component, the cursor plane drawn on the widget's surface and the short spline reaching out to it, interpolating the cursor between hits so it glides rather than jumps. Spawned by the widget interaction component or by a hand ability, never placed.
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | ScaleStyle | float | Size multiplier for the cursor and laser visuals. |
| var | ColorStyle | LinearColor | Colour of the cursor and laser. |
| var | Sound PressSound | SoundBase | Sound played when this pointer presses a widget. |
| var | Interp SpeedSettings | float | Speed at which the beam end follows the trace target. |
| fn | IsHoveringWidget | () → bool | Returns whether this pointer is currently over an interactive widget. |
| event | PressMouseButton | (SourceInfo: ST_SourceInfo) | Presses on the hovered widget, attributed to the given Source Info. |
| event | ReleaseMouseButton | (SourceInfo: ST_SourceInfo) | Releases on the hovered widget, attributed to the given Source Info. |
| event | ShowCursor | (Show: bool) | Shows or hides the pointer cursor without deactivating the pointer. |
| event | Deactivate | (DestroyAfterFadeOut: bool) | Fades the pointer out, optionally destroying the helper afterwards. |
| event | Activate | () | Fades the pointer in and starts tracing for widgets. |
| event | ScrollWheelInput | (SourceInfo: ST_SourceInfo, ScrollDelta: float) | Sends a scroll delta to the hovered widget, attributed to the given Source Info. |
| event | SetEndLocation | (TargetEndLocation: Vector) | Sets where the laser terminates, so it stops at the widget surface rather than passing through. |
| event | SetCurrentTrace | (CurrentTrace: HitResult) | Supplies the trace result the pointer should use this frame, when tracing is done by the owning ability. |