cancel
Showing results for 
Search instead for 
Did you mean: 

Update to Oculus Browser broke controller button input

future_forest
Explorer

It looks like a recent update to the Oculus Browser may have broken getting input for the A and B buttons with WebXR/THREE.js. Has anyone seen a similar issue or can confirm? I tested on Both a Quest 2 and a Quest Pro and both reproduce the issue.

Here's some example code which used to work:
https://github.com/fbriggs/lifecast_public/blob/main/web/lifecast_res/LifecastVideoPlayer8.js#L571

The most important parts of the code are:

renderer = new THREE.WebGLRenderer({
antialias: false,
powerPreference: "high-performance",
depth: true
});
...
vr_controller0 = renderer.xr.getController(0);
vr_controller1 = renderer.xr.getController(1);
...
vr_controller.button_A = vr_controller.gamepad.buttons[4].value > 0;
vr_controller.button_B = vr_controller.gamepad.buttons[5].value > 0;

1 ACCEPTED SOLUTION

Accepted Solutions

future_forest
Explorer

Update: the solution was to upgrade Three.js from version 131 to 149. On version 131, the issue was somewhere near here:
https://github.com/fbriggs/lifecast_public/blob/main/web/lifecast_res/LifecastVideoPlayer8.js#L581

The ''connected' event on the controller objects (renderer.xr.getController(0)) was never triggered with Three.js version 131, but is now in version 149. It is still a mystery why that worked before and then stopped working. I didn't find any race conditions.

View solution in original post

4 REPLIES 4

rcabanier
Honored Guest

Can you try visiting https://immersive-web.github.io/webxr-samples/controller-state.html and see if clicking A and B shows up while you're in immersive?

We haven't heard about any issues in this area.

Can you send us the link to a live website so we can debug.

We looked over your code and it's possible that there's a race condition in it.

future_forest
Explorer

Thanks for the quick reply. Here's a link to it running where it previously responded to A and B buttons but doesn't now:

https://holovolo.tv/v/e3c6ff

future_forest
Explorer

Update: the solution was to upgrade Three.js from version 131 to 149. On version 131, the issue was somewhere near here:
https://github.com/fbriggs/lifecast_public/blob/main/web/lifecast_res/LifecastVideoPlayer8.js#L581

The ''connected' event on the controller objects (renderer.xr.getController(0)) was never triggered with Three.js version 131, but is now in version 149. It is still a mystery why that worked before and then stopped working. I didn't find any race conditions.