Custom HUD & Widgets
Using the M2 Interaction menu while not using the M2 HUD
If you wish to use the M2 Interaction menu but are not using the rest of the M2 HUD, simply add WBP_M2_FullInteractionMenu
to your HUD.
Using a custom widget in place of the M2 Interaction menu
Replace the
WBP_M2_FullInteractionMenu
with your custom widget in your HUD.In the
HandleBootflowFinished
callback, get theM2_InteractableHandlerComponent
from the Morpheus actor of the owning player, and bind to necessary events.
Bind to
RequestInteractionMenu
to use for opening the menu.Bind to
RequestCloseInteraction
if you wish your widget to listen for requests to close from external sources.
Once an option has been selected, call
InteractWithOptionId
on the handler, with the interactable in question, and theOptionId
of the selected option.
It is important that your widget call CompleteInteraction on the Interactable Handler component upon closing; if you do not then the handler, and any external systems waiting for the broadcast, will think it is in a permanent state of interacting.
Using a custom widget to temporarily override a menu on a per Actor basis.
It is possible for each interactable to determine at run time if it wants to trigger the RequestInteractionMenu
broadcast, or use a custom widget. Please see the Custom Widget Spawner example for more information.
Last updated