diff --git a/78gnds8jrj.js b/78gnds8jrj.js index b376fe1..f26de47 100644 --- a/78gnds8jrj.js +++ b/78gnds8jrj.js @@ -36,6 +36,7 @@ this.speedPercentage = 0; this.initialCameraPosition = new THREE.Vector3(0, 1.1, 0); this.maximumCameraPosition = new THREE.Vector3(0, 2.6, 0); +this.currentCameraPosition = new THREE.Vector3(0, 1.1, 0); /** @@ -175,11 +176,9 @@ GameLib.CustomCode.prototype.adjustSpeed = function(delta) { this.speedPercentage = this.speed / this.maxSpeed; - var pos = this.initialCameraPosition.lerp(this.maximumCameraPosition, this.speedPercentage); - - console.log(this.speedPercentage); - - this.camera.position.y = pos.y; + this.currentCameraPosition.lerpVectors(this.initialCameraPosition, this.maximumCameraPosition, this.speedPercentage); + + this.camera.position.y = this.currentCameraPosition.y; this.camera.updateInstance('position'); }.bind(this);