3D UI Interactions

This page will teach you how to use the two types of Ultraleap user interface elements (UI) in your scene. Each user interface type is designed to make it easy for you as a developer to create the right UI for your project while maintaining intuitive ways for players to use their hands.

Note

Sample scenes can be found in:

  • Assets/Samples/Ultraleap Tracking/VERSION/XR Examples/2. Interactions/2. Physical UI.unity

  • Assets/Samples/Ultraleap Tracking/VERSION/XR Examples/2. Interactions/3. Hand Menu.unity


Quick Start with UI elements.

Note

For this example, we assume that you have an understanding of setting up a scene for hand tracking. If you do not, please check out the Your First Project Guide.

We offer several different types of UI which are built into the plugin. The quickest and easiest way to get started is to add the user interface elements to your scene via the Ultraleap toolbar. The tutorial below will allow you to add UI elements to your scene.

The two we will talk about on this page are:

3D UI Panel

../../../../../_images/3d-ui-panel.png

The 3D UI panel is a template for static user interfaces (i.e. anchored in the world).

Hand Attached UI

../../../../../_images/attachment-hand-ui.png

The hand attached UI panels are great for any user interface that you want to keep with the player at all times.

  1. From the Ultraleap toolbar, add the Physical Hands Manager.

Note

You can also access the prefabs using the right click context menu in the Hierarchy panel.

  1. Select the type of user interface that you would like to use by choosing the corresponding tab below.

  1. Add the 3D UI Panel to your scene.

Note

You can find this options under: Ultraleap > Physical Interaction > 3D UI Panel

  1. Once you have added the panel from the toolbar, open its children in the Hierarchy panel. Each section is shown here with the “Panel Cube” being the background element.

Note

You may delete sections you don’t need but will need to re-scale the “Panel Cube” to fit the new UI.

You can listen to UnityEvents that are attached to the Button and Slider components. This provides notifications when various states change on the interactable elements.

  1. Add an Attachment Hand Menu to your scene.

Note

You can find the UI options under: Ultraleap > Physical Interaction > Attachment Hand Menu

You can find more information on attachment hands via our Hand Attachments Documentation

  1. Once you have added the hand attached UI prefab from the toolbar you will see the attachment hand menu in the scene hierarchy. Expand its children fully. The points below explain the function of each part:

  • Attachment Hand Menu: This is the base of Attachment Hands. Game objects representing the locations selected in the “Attachment Transforms” view in the Inspector will appear below the Attachment Hand parent game object. This Example assumes you have not changed the default settings - so there is only one attachment point - the position of the palm centre.

  • Attachment Hand: this represents the parent object for each hand (you do not need to worry about it at this point).

  • Palm: this game object tracks the position of the palm and is the anchor point for the hand based user interface.

  • Palm UI Pivot: This object contains a script which enables and disables the user interface depending on whether your palm is facing the camera.

  • Buttons Panel & Cube UI Slider Panel: These are the user interface elements in the hand menu. Use the dropdowns below to learn more about them.

You may delete sections of the user interface you don’t need but will need to re-scale the “Background (BG elements)” to fit the size of the new UI.

../../../../../_images/attachment-hands-hierarchy.png

You can listen to UnityEvents from the Button and Slider components. These events provide notifications when the state of the interactable elements change.