Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨

1 Reply

Replies have been turned off for this discussion
  • kersk's avatar
    kersk
    Meta Employee
    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!