Forum Discussion
wangfys
4 years agoHonored Guest
OVRInput.GetUp() always returns false when OVRInput.Update() is called at the beginning of Update()
I have an object A with a script A.cs and an object B with a script B.cs
Script A.cs looks like
void Update() {
if (OVRInput.GetUp(OVRInput.RawButton.A)) {
DoSomething();
}
}Script B.cs looks like
void Update() {
OVRInput.Update();
if (OVRInput.GetUp(OVRInput.RawButton.B)) {
DoSomethingElse();
}
}
I found that DoSomething() is called normally but DoSomethingElse() is never called.
I found that OVRInput.GetUp(OVRInput.RawButton.B) always returns false.
I checked that OVRInput.Get(OVRInput.RawButton.B) worked fine. It returns true when pressed and returns false when not pressed. But OVRInput.GetUp(OVRInput.RawButton.B) and OVRInput.GetDown(OVRInput.RawButton.B) always returns false.
Accidentally, I found that I forgot to add OVRInput.Update() in A.cs and it worked normally. After deleting the OVRInput.Update() in B.cs, it now works fine.
So what's wrong? The official document said OVRInput.Update() should be called at the beginning of any components' Update() but adding it causes a bug.
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
- 8 years ago