Rufus31415 / Simple-WebXR-Unity

⭐ Bringing WebXR to Unity 3D ! B-)
https://rufus31415.github.io/webxr/MRTK-HandInteraction/
MIT License
576 stars 82 forks source link

In oculus browser not detect VR mode only AR Mode #56

Closed BussinessInnovation closed 1 year ago

BussinessInnovation commented 2 years ago

In oculus browser not detect VR mode, only detect AR Mode.

How can I force the VR mode on the Oculus Quest and keep the AR mode enabled on the smartphone?

thx!

Rufus31415 commented 2 years ago

As mentioned here, AR takes priority over VR. As Oculus now supports both, AR is chosen.

https://github.com/Rufus31415/Simple-WebXR-Unity/blob/492fa0893c2b41a7a39207cbc96a76707fa823c6/com.rufus31415.simplewebxr/Runtime/Plugins/WebGL/SimpleWebXR.jslib#L574

chismer commented 2 years ago

Ok. Thanks! How could I force VR to be activated in the case of Oculus? From unity could?

Rufus31415 commented 2 years ago

I suggest you replace the line with the following to force immersive-vr :

    navigator.xr.requestSession('immersive-vr', { optionalFeatures: ['local-floor', 'hand-tracking'] }).then(function (session) {
chismer commented 2 years ago

Thank you! I have already changed it. I've saved, restarted Unity, compiled and it's still detecting AR. Do I have to do something to compile the jslib?

Rufus31415 commented 2 years ago

You have nothing to do, the jslib is automatically included in the output binary. Try deleting your output directory before starting a new compilation so that you dont have incremental compilation but a complete compilation.

chismer commented 2 years ago

unfortunately it still detects AR.

AdrianBotana commented 1 year ago

I just tested this solution and it worked for me. Thanks!