Custom HUD & Widgets
Last updated
Last updated
Support for Interactions will be ending soon. This system will remain usable for a while but MSquared advises that you implement your own system to avoid any disruption once support ends.
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.
Replace the WBP_M2_FullInteractionMenu
with your custom widget in your HUD.
In the HandleBootflowFinished
callback, get the M2_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 the OptionId
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.
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.