cancel
Showing results for 
Search instead for 
Did you mean: 

OVRInput touch buttons always false

AdamMiltonBarker
Honored Guest

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. 

1 REPLY 1

AdamMiltonBarker
Honored Guest

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