Widget Interaction

Our widget interaction component are based on the Unreal Engine widget interaction components. These components enable hand based interactions with any UE widgets in your scene. Our components provide two modes to interact with widgets, covering FAR and NEAR interactions. Far interactions are used when the hand is too far away from a widget to manipulate it, hand movement along with a pinch gesture are used to control a virtual cursor. Near interactions happen when fingers touch widgets, similar to how we interact with controls on a touch screen. An option is available to switch between far and near mode automatically.


Adding LeapWidgetInteraction components

Open your hand actor, for this example we will be using /UltraleapTracking/InteractionEngine/BluePrints/LeapHandsIE2. Click on Add Component. Search for LeapWidgetInteraction, add one, then rename it LeapWidgetInteractionLeft. Add another component for the right, and name it LeapWidgetInteractionRight.

Make sure to change the LeapWidgetInteractionRight component’s Leap Hand Type to LEAP HAND RIGHT.

At this stage a cursor will be added to the widget you’re interacting with.

../../../../../_images/UE_UI_AddComponents.gif

Adding Laser Pointer Components

Laser pointers are nice to have and can be used to show where your hands are pointing within a widget’s bounds. In order to add them click on Add Component, search for IEPointerComponent. Add one to the left LeapWidgetInteractionLeft and name it IEPointerComponentLeft. Do the same thing with the right one, as shown:

../../../../../_images/UE_UI_AddPointers.gif

In the event graph of your hand actor make sure to set IEPointerComponentLeft using LeapWidgetInteractionLeft. Do the same with the right components.

../../../../../_images/42.png

Setting Up The Widget Actor

To set up your widget is straightforward, just add UltraleapUMG tag to the widget actor tags.

../../../../../_images/52.png

LeapWidgetInteraction Component Options

If you click on LeapWidgetInteraction you’ll find three categories of settings, UltraLeap UI showing settings for both Near and Far interaction modes, UltraLeap UI Near for direct touch and UltraLeap UI Far category for distant interactions with your widgets.

../../../../../_images/62.png

LeapWidgetInteraction Example Scene

A test map can found in: /UltraleapTracking/InteractionEngine/ExampleScenes/UltraleapMainTestMap. In the scene if you look to the left you’ll find a widget, click on UI Level by pinching from distance, or by directly touching that button. A widget streaming level will load. The interaction are set to switch automatically between Far/Near interaction.

../../../../../_images/UE_UI_ExampleScene.gif

Note

Our LeapWidgetInteraction inherits the Unreal Engine WidgetInteraction, therefor, it accesses its properties, for more details check the Unreal Docs here .


Back to top