Search Unity

I cant detect OVRInput on my script

Discussion in 'VR' started by guigasreis99, Mar 31, 2020.

  1. guigasreis99

    guigasreis99

    Joined:
    Jun 14, 2019
    Posts:
    3
    It's not working for me, for some reason. I spent the whole day testing to see if I could get it working, only for more furstration.
    The home button trick did nothing
    When I try to use OVRInput.GetDown(OVRInput.RawButton.Y) or OVRInput.Get(OVRInput.RawButton.Y) no input is detected.
    I did try with other buttons.

    I have the default OVR Player Conrtoller included in Oculus Assets, and that one is working for movement and camera rotation.
    I have installed the Oculus XR Plugin (v1.2.0), XR Management (v3.0.6) and XR Legacy Input Helpers (v1.3.11).
    On the Project settings I have everything setup as recommended by Oculus Developer Website.
    I am compiling and running on quest independently.

    Can someone help me?
    Thanks in advance
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Are you sure your app is running in Quest mode? Or is it running as a Go app (in which case, most of the controller buttons and motions are unmapped)?

    Easy way to tell is to move your head or walk around a bit. Are you getting 6DOF tracking?

    (Forgive me if this help is vague, or no help at all — it's been a little while since I last did much Go/Quest development.)
     
  3. guigasreis99

    guigasreis99

    Joined:
    Jun 14, 2019
    Posts:
    3
    I am running in quest mode, I can move around in the real world with my movement being translated to the virtual one
    Thank you for your help
     
  4. guigasreis99

    guigasreis99

    Joined:
    Jun 14, 2019
    Posts:
    3
    Solved!
    I am getting an Input from OVRInput using the Get(). Though I am unable to use the GetDown() or GetUp()
    I had to create my own code for that.
    Here's the code I used, Inside the Update:


    Code (CSharp):
    1. if (OVRInput.Get(MenuKey) || Input.GetKey("a"))
    2.         {
    3.             if (keyDown < 0)
    4.                 keyDown = 0;
    5.             keyDown++;
    6.         }
    7.         else
    8.         {
    9.             if (keyDown > 0)
    10.                 keyDown = 0;
    11.             keyDown--;
    12.         }
    13.  
    14.         if (keyDown == 1)
    15.             OpenMenu();
    16.  
    17.         if (keyDown == -1)
    18.             CloseMenu();
    Outside I have:
    Code (CSharp):
    1. private int keyDown = 0;
     
    JoeStrout likes this.