diff --git a/src/components/trail.js b/src/components/trail.js index 51cfcde..395aa0d 100644 --- a/src/components/trail.js +++ b/src/components/trail.js @@ -63,6 +63,10 @@ AFRAME.registerComponent('trail', { this.enabledTime = this.el.sceneEl.time; this.mesh.visible = false; } + + if (oldData.enabled && !this.data.enabled) { + this.mesh.visible = false; + } }, tock: function (time, delta) { diff --git a/src/index.html b/src/index.html index eb70bd1..eb64277 100644 --- a/src/index.html +++ b/src/index.html @@ -89,14 +89,14 @@ - + animation__posz="property: object3D.position.z; to: -8; startEvents: beatwrong; easing: easeOutQuart; dur: 4000" + animation__alpha="property: components.material.material.opacity; from: 1; to: 0; startEvents: beatwrong; easing: easeOutQuart; dur: 4000"> - - - - - + + + + + +