Skip to main content
Participant
September 15, 2021

OVRInput touch buttons always false

Hi all, 

The following code is always returning false, the only thing that works is trigger.

 

 

    void checkButtons()
    {
        print("OVRInput.GetDown(OVRInput.Button.One)");
        print(OVRInput.GetDown(OVRInput.Button.One));
        print("OVRInput.GetDown(OVRInput.Button.Two)");
        print(OVRInput.GetDown(OVRInput.Button.Two));
        print("OVRInput.GetDown(OVRInput.RawButton.X)");
        print(OVRInput.GetDown(OVRInput.RawButton.X));
        print("OVRInput.GetDown(OVRInput.RawButton.A)");
        print(OVRInput.GetDown(OVRInput.RawButton.A));
        if (OVRInput.GetDown(OVRInput.Button.One))
        {
            print("Button1");
            resetBlocks();
        }
        if (OVRInput.Get(OVRInput.Axis1D.SecondaryIndexTrigger) > 0.2f)
        {
            print("Trigger");
            RaycastHit hit;
            if (Physics.Raycast(transform.position, transform.forward, out hit, 30))
            {
                int pos = Array.IndexOf(materials, hit.collider.name);
                if (pos > -1)
                {
                    StartCoroutine(SendApiRequest(hit));
                }
            }
        }
    }
    void Update()
    {
        OVRInput.FixedUpdate();
        OVRInput.Update();
        checkButtons(); 
    }

 

 

 

I have searched for a couple of days and not found any solution. This is the final step in my app, just to detect A on touch and reset the blocks.

Any advice would be welcome. 

    This topic has been closed for replies.

    1 reply

    Participant
    September 18, 2021

    I resolved this by using Get instead of GetDown. Seems your documentation needs updating.