aframevr / aframevr/aframe

Gamepad buttons stop working in VR mode on Firefox for Android

Open
#4,853 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

When I switch to the VR mode on Firefox for Android and try to use the Gamepad keys, they don't work.
I use the Gamepad API with custom functions.
Everything works on PC in the normal and VR modes, and on Firefox Android in the normal mode. But as soon as I switch to the VR mode, the floor texture disappears, and the functions triggered by the Gamepad buttons stop working. I see that some buttons are triggered and could even see that some internal variables change. But the player is not moving.

Here are the error messages:
http://prnt.sc/12bwhr0
And this is what happens when I press the buttons on the Gamepad:
http://prnt.sc/12bwidm

I suspect it is somehow related to the ascene.js function:

function getCanvasSize (canvasEl, embedded, maxSize, isVR) {
  if (!canvasEl.parentElement) { return {height: 0, width: 0}; }
  if (embedded) {
    return {
      height: canvasEl.parentElement.offsetHeight,
      width: canvasEl.parentElement.offsetWidth
    };
  }
  return getMaxSize(maxSize, isVR);
}

But I don't see any values here, they are undefined. So, I don't even know if it is possible to debug.

I tried launching my page in Chrome for Android, but there, it is not even loaded.

As soon as I switch back to the normal mode, the buttons continue working.

  • A-Frame Version: 1.2.0
  • Platform / Device: Android 8.0, Firefox 88.1.1
  • Reproducible Code Snippet or URL:
    http://localhost/aframe/virus_inspector/level2-xless.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with A-Frame 1.2.0 on Android 8.0 using Firefox 88.1.1 and the linked level2-xless.html example. Start by inspecting the reported ascene.js getCanvasSize function and the supplied error screenshots; done means Gamepad buttons continue moving the player and the floor texture remains visible after entering VR mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.