cancel
Showing results for 
Search instead for 
Did you mean: 

Gear VR new controller & Unity button ID

dyfer
Honored Guest
Hi,

I would love to get the list of the Unity Buttons ID for the new Gear VR controller. I can only find the Oculus desktop ones :
https://docs.unity3d.com/Manual/OculusControllers.html

THX !
1 REPLY 1

kersk
Expert Protege
Hi dyfer,

The GearVR Controller is not yet exposed through Unity's input system. We recommend using OVRInput.cs found in our Oculus Unity Utilities package to develop against the GearVR Controller for now. 

Here's a quick example usage of that:
...

OVRInput.Controller controller = OVRInput.Controller.None;

if (
OVRInput.IsControllerConnected(OVRInput.Controller.LTrackedRemote))
{
controller = OVRInput.Controller.LTrackedRemote;
}
else if (OVRInput.IsControllerConnected(OVRInput.Controller.RTrackedRemote))
{
controller = OVRInput.Controller.RTrackedRemote;
}

Vector2 touchpadPos = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad, controller);
bool touchpadPressed = OVRInput.Get(OVRInput.Button.One, controller);
bool backButtonPressed = OVRInput.Get(OVRInput.Button.Two, controller);
bool triggerPressed = OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger, controller);

...

You can also refer to the docs here for more details:
https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovrinput/#unity-ovrinput

I hope that helps!