MozillaReality / unity-webxr-export

INACTIVE - Assets for creating WebXR-enabled Unity3D projects.
https://mixedreality.mozilla.org/unity-webxr-export/Build/
Apache License 2.0
622 stars 127 forks source link

Chrome Controller Position Null Value Error #430

Closed chadwickhar08 closed 1 month ago

chadwickhar08 commented 3 years ago

When attempting to launch a scene with controllers, an error occurs where the var position = sourcePose.transform.position line will be given a null value and the application crashes in Chrome if no controller is found or tracking is lost. A temporary fix was to check (in a not so DRY) manner the following in the webxr.js file:

... let sourcePose = frame.getPose(source.gripSpace, this.refSpace); if(sourcePose != null){ var position = sourcePose.transform.position; } else { var position = [0,0,0]; }

if(sourcePose != null){ var orientation = sourcePose.transform.orientation; } else { var orientation = [0,0,0]; }

//Structure of this corresponds with WebXRControllerData.cs

...