Skip to content

Commit 53c5ca0

Browse files
Use enter-vr event instead of sessionstart so that ar-mode is set before checking for it, this fix ar-hit-test component that was broken since 1.6.0 that changed some order in 77af389 (#5680)
1 parent 388eb8c commit 53c5ca0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/scene/ar-hit-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ export var Component = register('ar-hit-test', {
270270
this.hitTest = null;
271271
}.bind(this));
272272

273-
this.el.sceneEl.renderer.xr.addEventListener('sessionstart', function () {
273+
// Use enter-vr event instead of sessionstart so that ar-mode is set before this is called
274+
this.el.sceneEl.addEventListener('enter-vr', function () {
274275
// Don't request Hit Test unless AR (breaks WebXR Emulator)
275276
if (!this.el.is('ar-mode')) { return; }
276277

0 commit comments

Comments
 (0)