Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question UI Interaction issue with Hand tracking on Quest II

Discussion in 'VR' started by pouria77, May 27, 2022.

  1. pouria77

    pouria77

    Joined:
    Aug 13, 2014
    Posts:
    36
    I'm trying to test the UI interaction on the Quest II with hand tracking and ray casting.
    I've set up a very basic scene with all the default assets (OVRCameraRig, UIHelper) and added just a button to test the UI interaction.
    This is what my scene looks like:



    The issue I have is, when I run the scene, the Ray is rotated 90 degress, and it's attached to the wrist for some reason. I made a video here to show what I mean :

    It's still interacting with the UI though.
    Then after watching some online tutorials, I commented out these lines in the HandInputSelector.cs, which was attached to the UIHelper:

    Code (CSharp):
    1. void SetActiveController(OVRInput.Controller c)
    2.     {
    3.         /*
    4.         Transform t;
    5.         if(c == OVRInput.Controller.LTouch)
    6.         {
    7.             t = m_CameraRig.leftHandAnchor;
    8.         }
    9.         else
    10.         {
    11.             t = m_CameraRig.rightHandAnchor;
    12.         }
    13.         m_InputModule.rayTransform = t;
    14.       */
    15.     }
    and instead added a 2nd script to the UI helper, with these lines only:

    Code (CSharp):
    1. public OVRHand hand;
    2.     public OVRInputModule inputModule;
    3.  
    4.     private void Start()
    5.     {
    6.         inputModule.rayTransform = hand.PointerPose;
    7.     }
    Now the ray is at least attached to the correct position, but it still doesn't rotate properly with the hand movement. I made another video of it here :


    My Unity version is 2021.3.1f1
    Can someone please tell me what I'm doing wrong?

    Thank you.
     
  2. pouria77

    pouria77

    Joined:
    Aug 13, 2014
    Posts:
    36
    Anyone?
    I'd appreciate any hint to point me in the right direction.
     
  3. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    114
    I'm having the same issue only mine is rotated up. If I switch it from OpenXR to Oculus it points in the right direction. Anyone have an ideas how to fix this?
     
    pouria77 likes this.
  4. pouria77

    pouria77

    Joined:
    Aug 13, 2014
    Posts:
    36
    I'm beginning to think if this is just a bug for this version of Unity and oculus SDK? like no one else has these issues?