Custom Widget Spawner

How to show something over than the standard option menu

Experimental - Customers are encouraged to test and use this feature in their experiences, but it may still require some additional support

Overview

When using interactables, you may want to use the standard options menu available but in some cases you may wish to display your own custom widget (such as a visual representation for a vending machine). This page will detail how to create that, by walking you through our example object BP_Example_Interaction_WidgetSpawner.

Currently there is a known issue around a lack of events that elegantly handle the end of an interaction, meaning it can be tricky to determine when an interaction has ended and the widget needs to be hidden. An update is in progress that will add these hooks. For the time being we recommend your widget be set up in a way that can handle it's own lifespan, such as by including a close button.

How it works

Below are the steps to re-create this example object.

  1. Create an Actor you wish to have spawn a widget on interaction

  2. Add the M2_Interactable component

  3. Give the interactable a single option for showing the widget

  4. Create an event for On Button Option Requested

  5. Check that the "Show Widget" option is the one being actioned.

  6. Open your custom widget

Where To Find It

Our example of this can be found in the Approachability and Feature Test Gyms, or directly via

/Plugins/M2Unreal/JunoSkypark/Content/ObjectInteraction/Examples/CustomWidgetSpawner

Last updated