Using the MRTK for Touch Input #46
-
Hey, I didn't want to crash the Hit-Test Issue with that question, since we got that covered for Android and it is working now. However, I would like to have some description on how to properly use the MRTK as input manager to interact with Unity UI elements during an XRSession. I thought, that I had the MRTK set up properly but I'm recieving a warning now, which suggests, that something is not configured correctly in my project:
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Input sources are set up in "Input Data Provider" expandable menu that we see on your screenshot. |
Beta Was this translation helpful? Give feedback.
-
We're getting closer I think... I removed the Unity Touch Device Manager and it removed the warning. But I noticed that I already had your Input provider set. |
Beta Was this translation helpful? Give feedback.
-
So it should work. A touch on the screen in immersive session should raise a select event : Then the At next frame, the event is propagated to
At next frame, C# code set --> But maybe here is the issue : your smartphone only raises event In MRTK, this |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Okay, classic PICNIC issue here. So I probably didn't understand it correctly in the first place but all UI elements have to be world-canvases and they have to be configured for MRTK, otherwise the other elements like buttons etc. aren't interactable. The buttons themselves, however, can be standard Unity UI Buttons - as long as the canvas is configured for MRTK! :) Anyway, I appreciate your help and I love this repo so far. It makes designing AR apps for WebGL much more convenient as we are not bound to certain 3D object types but can also use .FBX etc. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your kind comment ;) Do not hesitate to contribute to SimpleWebXR if you have time and good ideas ! |
Beta Was this translation helpful? Give feedback.
Okay, classic PICNIC issue here. So I probably didn't understand it correctly in the first place but all UI elements have to be world-canvases and they have to be configured for MRTK, otherwise the other elements like buttons etc. aren't interactable. The buttons themselves, however, can be standard Unity UI Buttons - as long as the canvas is configured for MRTK! :)
Anyway, I appreciate your help and I love this repo so far. It makes designing AR apps for WebGL much more convenient as we are not bound to certain 3D object types but can also use .FBX etc.