From b6ea9df6349df072153c6f41b0e7d18f45023d25 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Fri, 10 Jan 2025 17:32:45 +0100 Subject: [PATCH] Wait this.referenceSpace to be set before calling this.initLayer --- src/components/layer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/layer.js b/src/components/layer.js index cda7580a55b..6f9d147dc30 100644 --- a/src/components/layer.js +++ b/src/components/layer.js @@ -212,6 +212,7 @@ module.exports.Component = registerComponent('layer', { tick: function () { if (!this.el.sceneEl.xrSession) { return; } + if (!this.referenceSpace) { return; } if (!this.layer && (this.el.sceneEl.is('vr-mode') || this.el.sceneEl.is('ar-mode'))) { this.initLayer(); } this.updateTransform(); if (this.data.src.complete && (this.pendingCubeMapUpdate || this.loadingScreen || this.visibilityChanged)) { this.loadCubeMapImages(); }