Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
wangfys's avatar
wangfys
Honored Guest
4 years ago

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.