Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Oculus Quest Node states only report one controller at a time

Discussion in 'AR/VR (XR) Discussion' started by EXP_Dev, Aug 5, 2019.

  1. EXP_Dev

    EXP_Dev

    Joined:
    Jun 9, 2016
    Posts:
    6
    Hey,
    I'm using the new XR system to get node states to update positions and events from controllers. It works fine on Vive and WMR but when I deploy to Oculus ques, using the InputTracking.GetNodeStates() only seems to get the state of a single hand controller at a time.

    It will begin by updating a single controller, then when I press a button or axis on the other controller it will update that controller and stop updating the other one.

    I'm on Unity 2019.2.0f1. Any input would be helpful :)

    Code (CSharp):
    1. // GET STATES
    2.             InputTracking.GetNodeStates(_States);
    3.  
    4.             // UPDATE CONTROLLER TRANSFORMS
    5.             for (int i = 0; i < _States.Count; i++)
    6.             {
    7.                 Debug.Log(i + "    " + _States[i].nodeType.ToString());
    8.  
    9.                 if (_States[i].nodeType == XRNode.LeftHand && _LeftController != null)
    10.                 {
    11.                     UpdateControllerTransform(_LeftController, _States[i]);
    12.                 }
    13.                 else if (_States[i].nodeType == XRNode.RightHand && _RightController != null)
    14.                 {
    15.                     UpdateControllerTransform(_RightController, _States[i]);
    16.                 }
    17.                 else if (_States[i].nodeType == XRNode.CenterEye && _HMD != null)
    18.                 {
    19.                     UpdateControllerTransform(_HMD, _States[i]);
    20.                 }
    21.             }
     
  2. Optrix

    Optrix

    Joined:
    May 30, 2017
    Posts:
    17
    This is a problem since one of the newest updates - there's a lot of noise on Reddit about it at the moment. People are saying that you can fix it by adding a new element to your android manifest file (which should REALLY be added automatically by the Oculus scripts, but hey...)

    They are saying you need to use "<uses-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1" />"

    I'm checking now and will let you know if I can fix the problem.