[Solved] WebXR - VR xr.supported set to false

I’m attempting to get WebXR working specifically the VR option with no success. In the debugger I’m getting that app.xr.supported = false and app.xr.isAvailable = false. I’m using the code from the Playcanvas tutorial “WebXR UI Interaction”. But just trying to get the VR to work, I haven’t used all the code that moves a cube. Testing the playcanvas tutorial on my samsung note8 works. But my project is giving me no love.

  • FYI
    I’m testing this on my samsung note8 using chrome devtools.

Is there something I haven’t enabled or is my code just missing some things?
my project:

Any help would be appreciated, thanks

I’ve tested a fork of this via the WebXR emulator for Chrome (https://playcanvas.com/editor/scene/950714) and it seems to be fine.

Also tried it on my Google Pixel 2 XL on Chrome, no problem there too.

Ok some weird stuff going on here. I tried your fork with no success initially. I tried it on 3 different computers running chrome and the WebXr emulator, the third computer worked ok. I went back to first computer and it started working once I opened the project first then launched it(the first time I was just linking directly to the launch address).
I went back to my original project and that was giving me a null reference to the _cameraEntity when the startXr method was being called. I was not getting this error before.
I went into the playcanvas editor and clicked the Root object in the hierarchy where the xrinit script is attached and pressed the Parse button and added the Camera in the scene again. Everything is now working.

I guess I did something wrong somewhere along the line? I have no idea. At least it’s working now

Thanks for your help

1 Like

Ah yes, I had to fork the project to fix that error.