Jelajahi Sumber

show errors when creating XR in non-XR environment

Raanan Weber 5 tahun lalu
induk
melakukan
e8c849ac6a
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      src/Cameras/XR/webXRDefaultExperience.ts

+ 5 - 0
src/Cameras/XR/webXRDefaultExperience.ts

@@ -7,6 +7,7 @@ import { WebXREnterExitUI, WebXREnterExitUIOptions } from './webXREnterExitUI';
 import { AbstractMesh } from '../../Meshes/abstractMesh';
 import { WebXRManagedOutputCanvasOptions } from './webXRManagedOutputCanvas';
 import { WebXRMotionControllerTeleportation } from './features/WebXRControllerTeleportation';
+import { Logger } from '../../Misc/logger';
 
 /**
  * Options for the default xr helper
@@ -116,6 +117,10 @@ export class WebXRDefaultExperience {
             }
         }).then(() => {
             return result;
+        }).catch((error) => {
+            Logger.Error("Error initializing XR.");
+            Logger.Error(error);
+            return result;
         });
     }