Forum Discussion
AdamMiltonBarker
5 years agoHonored Guest
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.
1 Reply
Replies have been turned off for this discussion
- AdamMiltonBarkerHonored Guest
I resolved this by using Get instead of GetDown. Seems your documentation needs updating.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago