Forum Discussion
future_forest
3 years agoExplorer
Update to Oculus Browser broke controller button input
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;
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.
4 Replies
- rcabanierHonored 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.
- rcabanierHonored Guest
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_forestExplorer
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_forestExplorer
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.
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
- 10 days ago