diff --git a/src/systems/tunnel-effect.js b/src/systems/tunnel-effect.js index 99d44bb6942413afdc3396645f08af625cd847f3..b3d6ad6c2fa53c5744c5544ae1a55bc2dad26236 100644 --- a/src/systems/tunnel-effect.js +++ b/src/systems/tunnel-effect.js @@ -25,12 +25,13 @@ AFRAME.registerSystem("tunneleffect", { }, init: function() { + const { radius, minRadius, maxSpeed } = this.data; this.scene = this.el; this.isMoving = false; this.isVR = false; this.dt = 0; this.isPostProcessingReady = false; - this.deltaR = TARGET_RADIUS - this.minRadius; + this.deltaR = TARGET_RADIUS - (radius - minRadius) * maxSpeed - minRadius; this.deltaS = this.softness - TARGET_SOFTNESS; this.characterEl = document.querySelector(`a-entity[${this.data.targetComponent}]`); if (this.characterEl) {