- Home /
How to check if Oculus controller is currently visible (active)
Oculus skd automatically enables/disables hands if a controller is picked up or put down. How do I check if a controller is currently active?
I can check the gameobject of the hand to see if it's activeInHierarchy but that game object is automatically created after startup and it's managed from script.
Would be great if Oculus SDK has a function for that.
Thanks
Answer by kavanavak · Sep 11, 2020 at 11:29 PM
Here's a way to do it:
private void Update() { if (OVRInput.GetActiveController() == OVRInput.Controller.LTouch) { Debug.Log("ONLY L TOUCH is ACTIVE"); } if (OVRInput.GetActiveController() == OVRInput.Controller.RTouch) { Debug.Log("ONLY R TOUCH CONTROLLER IS ACTIVE"); } if (OVRInput.GetActiveController() == OVRInput.Controller.Touch) { Debug.Log("BOTH CONTROLLERS ARE ACTIVE"); } if (OVRInput.GetActiveController() == OVRInput.Controller.None) { Debug.Log("NO CONTROLLER IS ACTIVE"); } }