Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRTK3 NonNativeKeyboard & vanilla UGUI doesn't support near touch #11557

Closed
AMollis opened this issue May 16, 2023 · 3 comments
Closed

MRTK3 NonNativeKeyboard & vanilla UGUI doesn't support near touch #11557

AMollis opened this issue May 16, 2023 · 3 comments

Comments

@AMollis
Copy link
Member

AMollis commented May 16, 2023

This issue has been migrated a new MRTK repository, and the status of this issue will now be tracked at the following location:


Describe the bug

MRTK3 NonNativeKeyboard & vanilla UGUI doesn't support near touch. MRTK2's non native keyboard & vanilla UGUI supported near touch.

To reproduce

Steps to reproduce the behavior:

  1. Open NonNativeKeyboard.scene
  2. Click text box to open non-native keyboard
  3. Try to enter text with near touch
  4. Can't near touch the keyboard

Or

  1. VanillaUGUIExample.scene
  2. Try to interact with UGUI canvas via near touch
  3. Near touch doesn't work

Expected behavior

Near touch to work on MRTK3's non-native keyboard & with vanilla UGUI, just like MRTK2

Screenshots

Your setup (please complete the following information)

  • Unity Version 2021.3
  • MRTK Version 3.0.0-pre

Target platform (please complete the following information)

  • HoloLens 2

Additional context

Add any other context about the problem here.

@AMollis AMollis added the Bug label May 16, 2023
@AMollis AMollis added this to the MRTK v3.0 GA milestone May 16, 2023
@github-actions github-actions bot added the MRTK3 label May 16, 2023
@AMollis AMollis changed the title MRTK3 NonNativeKeyboard doesn't support MRTK3 NonNativeKeyboard doesn't support near touch May 16, 2023
@github-actions github-actions bot added the MRTK2 label May 16, 2023
@AMollis AMollis changed the title MRTK3 NonNativeKeyboard doesn't support near touch MRTK3 NonNativeKeyboard & vanilla UGUI doesn't support near touch May 16, 2023
@AMollis AMollis self-assigned this Jun 23, 2023
@AMollis
Copy link
Member Author

AMollis commented Jul 1, 2023

To properly implement this we need to switch to using Unity XRI's XRPokeInteractor. The XRPokeInteractor implements IUIInteractor and registers itself with the scene's XRUIInputModule.

We're unable to implement and use IUIInteractor on MRTK's PokeInteractor. To correctly implement IUIInteractor, we need to be able to set TrackedDeviceModel.pokeDepth and TrackedDeviceModel.interactionType. However, interactionType and pokeDepth are internal fields and can't be accessed by MRTK.

@AMollis
Copy link
Member Author

AMollis commented Jul 5, 2023

I attempted to update the MRTK3's PokeInteractor to derive from XRPokeInteractor. This almost work. However, MRTK3's InteractionModeHandler is getting in the way. The InteractionModeHandler is using MRTK3's IInteractionModeDetector to device what mode to change to (e.g. "near", "far", ect.). However, there is no detector for detecting if an interactor is near UGUI. This results in the PokeInteractor being disabled. If the PokeInteractor is disable, XRPokeInteractor can't do it's work to update UGUI interactions.

To properly use XRPokeInteractor, MRTK should consider switch to use XRI's XRInteractionGroup, instead of the IInteractionModeDetector method.

At this point, I don't believe there to be an easy way for MRTK3 to support UGUI with the poke interactor. Not until the MRTK3's default rig is modified to use XRI's 'XRPokeInteractorand XRInteractionGroup`.

As workaround, if someone really wanted to use UGUI, they'll have to add colliders and IXRInteractable to the UGUI components.

@AMollis
Copy link
Member Author

AMollis commented Jul 5, 2023

Given the limitations here, the best option seems to be update MRTK3's rig to use the new XRI components. As such, this issue is depended upon the following:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants