From b2ca28315475d4ddca4b2a459a4a5b9efa5c6ed5 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Thu, 9 Apr 2020 18:16:40 +0200 Subject: [PATCH] Fix look-at="#camera" not working in immersive mode --- components/look-at/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/look-at/index.js b/components/look-at/index.js index eecb2fef..c3de10e4 100644 --- a/components/look-at/index.js +++ b/components/look-at/index.js @@ -89,7 +89,8 @@ AFRAME.registerComponent('look-at', { var vector = this.vector; if (target3D) { - target3D.getWorldPosition(vec3); + target3D.updateMatrixWorld(); + vec3.setFromMatrixPosition(target3D.matrixWorld); if (this.el.getObject3D('camera')) { // Flip the vector to -z, looking away from target for camera entities. When using // lookat from THREE camera objects, this is applied for you, but since the camera is