Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
volkerku's avatar
volkerku
Explorer
5 years ago

Quest: check if HandTracking or Controller is active

Is there a way in Unity to check if Handtracking is active or controller?
With OVRHand.IsTracked I can check if a hand is currently tracked, but this does not tell me if handtracking is active.

Also, is there a similar command to check if teh Quest lost controller tracking (controller out of sight of quest cameras)?

4 Replies

  • I encountered this problem as well since IsTracked is always true so I can't depend on it.

    My solution is a bit of a hack but it solved the problem for me. Just expose the variable shown below in OVRMeshRenderer class and make use of it in your own class. This variable is true when the hand is visible (hand tracking mode) and false otherwise. OVRMeshRenderer is a component inside the OVRHands prefab which is instanced per hand.

     

        public bool shouldRender = false;//My Hacky Fix CODE
        private void Update()
        {
            if (_isInitialized)
            {
                //bool shouldRender = false;//Original CODE
    
                if (_dataProvider != null)
                {
                    var data = _dataProvider.GetMeshRendererData();

     

    • korinVR's avatar
      korinVR
      Expert Protege

      I use OVRInput.IsControllerConnected(OVRInput.Controller.Hands) to check if hand-tracking mode is active.

      • MaoLux's avatar
        MaoLux
        Honored Guest
        OVRInput.IsControllerConnected(OVRInput.Controller.LHand) 
         
        LHand and RHand if you want to differentiate handness
         
  • Well im a bit late here but anyways... You can use OVRPlugin.GetHandTrackingEnabled() to check if hand tracking is enabled