09-15-2021 09:38 AM - edited 09-19-2021 05:52 AM
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.
09-18-2021 05:16 AM - edited 09-19-2021 05:51 AM
I resolved this by using Get instead of GetDown. Seems your documentation needs updating.