cancel
Showing results for 
Search instead for 
Did you mean: 

OVRInput.GetDown not working on Touch controllers in unity?

Gnimmel
Explorer
I am having a hard time getting the buttons to work reliably on the oculus touch controllers in unity.

If I use if OVRInput.GetDown it never seems to work, but using OVRInput.Get works all the time?

I wasn't sure if it was something to do with OVRInput.Update (); and I've tried adding it to 1 script and all the scripts that detect input but both ways give the same results, .GetDown will not work, but .Get will?

Is there a step I'm missing?
23 REPLIES 23

sivandan2000
Honored Guest
Still happening in 2019.5f1. I cant seem to find the problem.. Any workaround?

SentientDragon5
Honored Guest
Still happening in 2019.3.15f1 
I made my own function for this and it seems to be working with both the button press of the Start button and the hand tracking version (left hand palm index to thumb) and Got this to work:


    public OVRInput.Button pauseButton = OVRInput.Button.Start;
   
    public GameObject pauseEffect;

    public bool GameIsPaused = false;

    private bool pressedLastFrame = false;
    private bool pressedThisFrame = false;
    
    void Update()
    {
        // call these two if you want OVR controller Input
        OVRInput.Update();
        OVRInput.FixedUpdate();

        //pressedThisFrame will only be triggered like GetButtonDown, and pressedLastFrame will remain true until you stop pressing the specified button.
        pressedThisFrame = OVRInput.Get(pauseButton) && !pressedLastFrame;
        
        if (pressedThisFrame)
        {
            if (!GameIsPaused)
            {
                Pause();
            }
            else if (GameIsPaused)
            {
                Resume();
            }
        }

        pressedLastFrame = OVRInput.Get(pauseButton);
        pauseEffect.SetActive(GameIsPaused);
    }

Hope this helps!

dangerEn94
Honored Guest
This is still happening in 2020... What is taking so long to fix???

kavanavak
Expert Protege
unity 2020.1.5 + latest everything else on Quest, same issue

DavidW-MR
Honored Guest
I was having this issue too, for me the issue was that I was calling OVRInput.Update and OVRInput.FixedUpdate in one of my own scripts, but these are already called by OVRManager.  The documentation implies you need to include OVRManager and call those functions, but I think they mean to do either/or.

zdh3110
Explorer
Same issue on my end in all of the following four cases: Unity 2019.4.11+
1. Legacy Unity XR SDK + Oculus Rift link (run in editor)
2. Legacy Unity XR SDK + Oculus Quest (apk)
3. New Unity XR SDK + Oculus Rift link (run in editor)
4. New Unity XR SDK+ Oculus Quest (apk)

eovento
Protege

DavidW-MR said:

I was having this issue too, for me the issue was that I was calling OVRInput.Update and OVRInput.FixedUpdate in one of my own scripts, but these are already called by OVRManager.  The documentation implies you need to include OVRManager and call those functions, but I think they mean to do either/or.


Thank you VERY much, Sir, This one fixed it for me.

Was I doing it wrong since ever?... Documentation clearly says:

  • Include an instance of OVRManger anywhere in your scene.
  • Call OVRInput.Update() and OVRInput.FixedUpdate() once per frame at the beginning of any component’s Update and FixedUpdate methods, respectively.
So I was doing both "requirements"... placing OVRManager in the Scene AND calling both Update and FixedUpdate from a script I made. GetDown wasn't working, and as soon as I removed both calls from my script, it started working.

(Quest 1, Unity 2019.3.15)

zdh3110
Explorer

DavidW-MR said:

I was having this issue too, for me the issue was that I was calling OVRInput.Update and OVRInput.FixedUpdate in one of my own scripts, but these are already called by OVRManager.  The documentation implies you need to include OVRManager and call those functions, but I think they mean to do either/or.



eovento said:


DavidW-MR said:

I was having this issue too, for me the issue was that I was calling OVRInput.Update and OVRInput.FixedUpdate in one of my own scripts, but these are already called by OVRManager.  The documentation implies you need to include OVRManager and call those functions, but I think they mean to do either/or.


Thank you VERY much, Sir, This one fixed it for me.

Was I doing it wrong since ever?... Documentation clearly says:

  • Include an instance of OVRManger anywhere in your scene.
  • Call OVRInput.Update() and OVRInput.FixedUpdate() once per frame at the beginning of any component’s Update and FixedUpdate methods, respectively.
So I was doing both "requirements"... placing OVRManager in the Scene AND calling both Update and FixedUpdate from a script I made. GetDown wasn't working, and as soon as I removed both calls from my script, it started working.

(Quest 1, Unity 2019.3.15)


You two are right and thanks a lot! This issue was solve on my end by removing the Update() calls. For future people who have the same issue, I'm not using FixedUpdate(), but try to remove that too and check if that'll work.

rkachach
Honored Guest
Thank you very much. I spent a lot of time trying to figure out what's wrong it turnet out I have an OVRInput.Update() call in one of my scripts. I removed it and everything started to work like a charm :smile:

zigziglagirafe
Honored Guest

Oh God thank you ! That solves the problem !

First time ever I regret I read the documentation...