Rufus31415 / Simple-WebXR-Unity

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

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

Closed BussinessInnovation closed 1 year ago

BussinessInnovation commented 1 year 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 1 year 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 1 year ago

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

Rufus31415 commented 1 year 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 1 year 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 1 year 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 1 year ago

unfortunately it still detects AR.

AdrianBotana commented 1 year ago

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