HoloLens - UI/Slider and Cursor do not intersect during gaze

ⅰ亾dé卋堺 提交于 2019-12-07 19:32:00

问题


I'm trying to use UI/Slider in Unity app for HoloLens. I used the steps described here - Unity UI on the HoloLens

So as a result I have following structure:

MainCamera properties:

SliderCanvas is using MainCamera:

Slider properties:

InteractiveMeshCursor is taken from HoloToolkit.

As a result I'm getting this picture:

When I move the head the Cursor behaves correctly - it stays in the middle of the scene. If I add other 3D objects on the Scene it also correctly changes its states so GazeManager looks like is working correctly.

However I cannot gaze at Slider because it moves with the Camera too and stays in the bottom/center of the scene where I want it to be. So in my case there is no way for them to intersect.

How can I fix this? Do I need to add an other Camera for the SliderCanvas but then how to control both cameras? I am definitely missing something and would appreciate your help.


回答1:


As expected the solution turned out to be simple (I missed one step from the tutorial). For UI objects you need to set Render Mode property for the Canvas to World Space and changed the Position and Scale of the Slider. Now the Gaze is working.

SliderCanvas properties:

Slider properties:



来源:https://stackoverflow.com/questions/43942382/hololens-ui-slider-and-cursor-do-not-intersect-during-gaze

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!