Search code examples
c#unity-game-engineoculus

How do I change the Grab Button and "Button" Click button on Oculus Touch controllers?


The default buttons for grab is "Axis1D.PrimaryHandTrigger" and for the button click is "Button.One". Although these are the default ones, I would like to change the settings so it can take in different inputs.

I could not find where and how the input is added to these OVR touch controllers.


Solution

  • Check this official docs by unity for VR inputs with their Unity Axes IDs.

    Go to the Project Settings and select Input. There you can change one of the input for your custom VR input as shown in the picture below:

    enter image description here

    Also change the Axis from Y axis to 11th axis (joystick) and untick Invert. See the picture below:

    enter image description here

    Now you can call them in your script like this example:

    void Update()
        {
            if(Input.GetAxis("Vertical") == 1)
            {
                //Do something
            }
        }