When exiting XR I get the following error. I tried running the tutorial examples, but they give a similar error. Is there anyway to work around these?
I tested running https://playcanvas.com/project/460449/overview/webvr-ray-input with the WebXR device emulator browser extension (with emulated devices that have a least 1 controller) and running the code on the Oculus Quest. Both give the same result.
TypeError: Cannot read property ‘parent’ of null
at XrInputSource._updateTransforms (playcanvas-stable.dbg.js:23840)
at XrInputSource.getPosition (playcanvas-stable.dbg.js:23876)
at script.Controller.update (controller.js?id=30505832&branchId=87c5dc0c-00a1-4cec-9211-6c6a8b44b83c:39)
at ScriptComponent._scriptMethod (playcanvas-stable.dbg.js:29892)
at ScriptComponent._onUpdate (playcanvas-stable.dbg.js:29928)
at ScriptComponentSystem._callComponentMethod (playcanvas-stable.dbg.js:30343)
at ScriptComponentSystem._onUpdate (playcanvas-stable.dbg.js:30352)
at Function._helper (playcanvas-stable.dbg.js:26801)
at Function.update (playcanvas-stable.dbg.js:26809)
at Application.update (playcanvas-stable.dbg.js:26224)
And this one in the minified version:
playcanvas-stable.min.js:1004 Uncaught TypeError: Cannot read property ‘parent’ of null
at a._updateRayTransforms (playcanvas-stable.min.js:1004)
at a.getOrigin (playcanvas-stable.min.js:1006)
at c.Controller.update (__game-scripts.js:1)
at e._scriptMethod (playcanvas-stable.min.js:1225)
at e._onUpdate (playcanvas-stable.min.js:1226)
at b._callComponentMethod (playcanvas-stable.min.js:1240)
at b._onUpdate (playcanvas-stable.min.js:1241)
at Function._helper (playcanvas-stable.min.js:1110)
at Function.update (playcanvas-stable.min.js:1111)
at e.update (playcanvas-stable.min.js:1086)
Unfortunately, I still experience the error. With the emulator and on the Quest. I checked and it’s using version 1.27.1 Revision. So it might be my code in this case.
Hi @Sorskoot. So it’s a bit hard to debug the published app. When I look at your project, I notice that it’s based on the now deprecated WebVR API. The crash in your published app seemed to be in code managing WebXR input sources. So maybe there’s a clash there between the WebVR and WebXR code inside the engine.
I went to debug your game by launching from the Editor. I see it’s changed a bit from the published build. The script ‘controller’ no longer exists. And when I launch the scene, there’s immediately an error:
[web-vr-ui.js?id=30344978&branchId=97f609e8-c89e-45b7-8df8-261db7c3acd4:76]: Uncaught TypeError: Cannot read property 'isSupported' of null
TypeError: Cannot read property 'isSupported' of null
at HTMLDivElement.onEnterVrPressedEvent (https://launch.playcanvas.com/api/assets/files/scripts/web-vr-ui.js?id=30344978&branchId=97f609e8-c89e-45b7-8df8-261db7c3acd4:76:33)
If you can get the main scene in a state where it’s debuggable, let me know.
Hi @will, I’m not sure what happened, but I’m not using web-vr-ui.js anymore. I removed the file my project earlier this week. But you gave me some ideas to try. This is the project. There are a few branches in there as well.
(Note: It’s a private project that I very quickly hacked together to get working. There’s lots of new features from the XR integration from Max that isn’t used and should be used in there )