createDefaultVRExperience on Android Chrome: Blue Flashes and Camera Jumps

I’m having two problems on Android (Chrome) that may or may not be related. I’ve created a playground here to illustrate, in case it helps: https://playground.babylonjs.com/#NWW1K1#10

I load in a babylon file and place a red sphere directly below the camera (you’ll need to look down). I use the following code to detect when the user touches the sphere:

sphere.actionManager = new BABYLON.ActionManager(scene);
sphere.actionManager.registerAction(
    new BABYLON.ExecuteCodeAction(
        BABYLON.ActionManager.OnPickTrigger,
        () => { 
            console.log("test");
        },
    ),
);

It works well in Chrome on my desktop. But when I use Chrome on my Android G6 (even before entering VR mode), I get the following two problems:

  1. The screen flashes blue on touch. Can that be disabled?
  2. More importantly, the camera occasionally jumps away from the sphere, and then quickly jumps back. It’s almost as if babylon is briefly switching to a different camera. This can be quite jarring at times. But it doesn’t happen with every touch, and it never happens on desktop.

Would this be a question for @trevordev ?

Thanks in advance for your help.

Yes @trevordev is the local VR expert :smiley:

Thanks for raising this issue. On devices that don’t support webVR, babylon fallsback to a vrDeviceOrientationCamera to handle the rotation from the orientation sensor. For some reason the camera is still being controlled by mouse input even while being controlled by the orientation sensor. I’ll try to create a PR to disable the mouse control when the orientation sensor is activated to hopefully make it work as expected for your use case.