-1

In my project, I have created UI elements with the UI Toolkit from Unity.

Now I want to get this working on the Hololens 2. However, when I run it, the UI elements are not visible. But in Unity you can see them in the player view and everything works fine.

tabea
  • 1

1 Answers1

0

To make the UI elements under the Unity Canvas work on the HoloLens, please follow these steps:

  1. Select Canvas object in your scene, then in the Inspector panel for your Canvas, click "Convert to MRTK Canvas"
  2. Click "Add NearInteractionTouchableUnityUI"
  3. Set the Rect Transform component's X, Y, and Z scale to 0.001

If you're new to MRTK or Mixed Reality development in Unity, we recommend you start with this doc: What is the Mixed Reality Toolkit

Hernando - MSFT
  • 2,895
  • 1
  • 5
  • 11
  • Hi, Thanks you for your answer but the problem is that I don't use the normal UI elements from Unity but the UI elements from the UI Toolkit from Untiy. – tabea Feb 25 '22 at 10:47
  • From Unity blog, The only way to use UI Toolkit in VR at the moment is to render UI panels into textures and render them onto planes. Please take a look at this comment under the Unity Blog:[What’s new in UI Toolkit?](https://blog.unity.com/technology/whats-new-in-ui-toolkit?__vfz=medium%3Dcomment_share#vf-a7efe2aa-1c8d-49ed-92c6-1d496958b2b4) – Hernando - MSFT Feb 28 '22 at 09:13