Hello,
I have a VR scene in which I have a UI on canvas.
I use scripts on the canvas to add click listener
_button?.onClick.AddListener(myAction);
Everything works fine.
Now I want to be able to hide/show this UI by pressing the handTrigger on the oculus controler, so I added the following code:
OVRInput.Update(); // Call before checking the input
if (OVRInput.Get(OVRInput.Axis1D.PrimaryHandTrigger, OVRInput.Controller.RTouch) > 0.2f)
{
indexRTriggerPressed = true;
}
if (OVRInput.Get(OVRInput.Axis1D.PrimaryHandTrigger, OVRInput.Controller.RTouch) == 0 && indexRTriggerPressed)
{
activeUI();
indexRTriggerPressed = false;
}
This works for showing/hiding my UI, but it seems that OVRInput.Update(); catch all the controler events, so my buttons on the canvas doesn’t work anymore.
So, how can I mix this two ways of getting the controller inputs ?