diff --git a/components/look-at/index.js b/components/look-at/index.js index c493b75f..4555f0c9 100644 --- a/components/look-at/index.js +++ b/components/look-at/index.js @@ -60,7 +60,8 @@ AFRAME.registerComponent('look-at', { // Look at a position. if (typeof target === 'object') { - return this.lookAt(new THREE.Vector3(target.x, target.y, target.z)); + this.lookAt(new THREE.Vector3(target.x, target.y, target.z)); + return this.endTracking(); } // Assume target is a string. @@ -102,6 +103,10 @@ AFRAME.registerComponent('look-at', { this.target3D = targetEl.object3D; }, + endTracking: function () { + this.target3D = null; + }, + cameraListener: function (e) { if (e.detail && e.detail.name === 'camera') { this.update(); diff --git a/components/look-at/package.json b/components/look-at/package.json index f10975fa..ada7c461 100644 --- a/components/look-at/package.json +++ b/components/look-at/package.json @@ -28,7 +28,7 @@ }, "homepage": "https://github.com/supermedium/superframe/tree/look-at#readme", "devDependencies": { - "aframe": "^0.5.0", + "aframe": "^1.2.0", "browserify": "^12.0.1", "budo": "^7.1.0", "shelljs": "^0.6.0",