From 69445acaef7170564af145d0da0c367fb4f09957 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Fri, 12 Oct 2018 03:52:11 -0700 Subject: [PATCH] fix wall not reappearing on pause --- src/components/wall.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/wall.js b/src/components/wall.js index 9a5394b..7d644b7 100644 --- a/src/components/wall.js +++ b/src/components/wall.js @@ -11,6 +11,10 @@ AFRAME.registerComponent('wall', { this.el.object3D.visible = false; }, + play: function () { + this.el.object3D.visible = true; + }, + tock: function (time, delta) { this.el.object3D.position.z += this.data.speed * (delta / 1000); this.returnToPool(); @@ -19,6 +23,7 @@ AFRAME.registerComponent('wall', { returnToPool: function () { if (this.el.object3D.position.z < this.maxZ) { return; } this.el.sceneEl.components.pool__wall.returnEntity(this.el); + this.el.object3D.position.z = 9999; this.el.pause(); }, });