From 4df1a9aa09690ed03f49ae04bab0167d554f5a23 Mon Sep 17 00:00:00 2001 From: M C Date: Fri, 25 Aug 2017 15:22:13 -0400 Subject: [PATCH] looks like the setTimeout is still needed for the VREffect to be available --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index df17888c14b..151222faa52 100644 --- a/src/index.js +++ b/src/index.js @@ -117,5 +117,6 @@ module.exports = window.AFRAME = { // Enter VR on `vrdisplayactivate`, to handle in-VR traversal much earlier in the lifecycle. // This event may also fire in other circumstances (e.g. putting on the Rift headset). window.addEventListener('vrdisplayactivate', function (evt) { - if (window.AFRAME.scenes.length > 0) { window.AFRAME.scenes[0].enterVR(); } + var s = window.AFRAME.scenes[0]; + if (s.effect) { s.enterVR(); } else { setTimeout(s.enterVRBound); } });