Virtual Reality bugs when I enable Interactions on Microsoft Edge+Safari

Hi guys, I need help, I want to enable Interactions with the Vr so I use vrHelper.enableInteraction(), but when I am mooving the camera VR with the mouse, it’s not working, the camera is looking to the top. Only on Microsoft Edge and Safari.
I don’t know if it’s only me, try it on Microsoft Edge or Safari : https://www.babylonjs-playground.com/#14KRGG#78
If you comment vrHelper.enableInteractions(), you don’t have bugs…
When I try it on Firefox, the vr is linked to the mouse, but on Microsoft Edge I have to click on my mouse to turn the camera before it’s bugging. Maybe the problem is linked to that.

By the way I need to work on Microsoft Edge for my website that’ why I am asking that.
Thank you for reading and helping me.

Mathieu

Adding our VR GURU @trevordev

Thanks for finding this, I created this issue VR enableInteractions not working in Edge · Issue #6418 · BabylonJS/Babylon.js · GitHub, ill see if i can find a fix

1 Like

@Mathieu
The issue seems to be that pointerLock is not available in fullscreen mode in edge. (See this webpage also failing Fullscreen API, Pointer Lock API & Panoramic images in three.js)

I created a PR here which should fix the camera movement issues by disabling camera gaze rays when the pointer is not locked disable mouse pointer gazer when pointer is not locked by TrevorDev · Pull Request #6421 · BabylonJS/Babylon.js · GitHub does that work for you?

Hi, sorry I was on holiday, thank you for your answer, but your link is not working like you said. I will try what you said but I think I am not going to succeed. If I use vrExperience Helper I can modify after calling this function what you said ? Hmm, I think I don’t understand what you want me to do :S Sorry, but did you fix the problem on github so I can try it on my test ? Or you will try to fix ? Because I found a github page with a few lines of code modified ^^

So I understand what you did. It is working, but now I can’t use interactions with the gaze on my sphere.I am talking of the VR on my computer of course.
Maybe the problem is like you said, on firefox, we have just to move the mouse to move on VR but on edge, you have to press the button and moove the mouse to move on VR

I found a solution but I do like if I was bob the handyman :smiley: So I did that :
vrHelper.onEnteringVR.add( () => {
scene.getEngine().isPointerLock = true;
});

I active the pointerLock when I am entering on VR and if you want to disable when you are out of VR, you can do that :

vrHelper.onExitingVR.add( ()=> {
scene.getEngine().isPointerLock = false;
})

1 Like

@trevordev : I change scene.getEngine().isPointerLock = true by setTimeout(()=>{ scene.getEngine().isPointerLock = true; }, 1000)

Because on Edge/Safari, if you don’t set a setTiemout your mouse is directly in the bottom, so it’s more difficult to move with vr.

We should fix the fact that in Edge/Safari, the mouse doesn’t disapear. You know a function who can do that? Because on firefox, the mouse desapears.

The issue seems to be that pointerLock is not available in fullscreen mode in edge. (See this webpage also failing Fullscreen API, Pointer Lock API & Panoramic images in three.js)

1 Like