diff --git a/src/components/cursor-controller.js b/src/components/cursor-controller.js index 318c75916f8fea6cb1ded5a2050f32cd1411f008..7c898556f4a9de22d8771aa251c819295c43a78c 100644 --- a/src/components/cursor-controller.js +++ b/src/components/cursor-controller.js @@ -173,11 +173,10 @@ AFRAME.registerComponent("cursor-controller", { const { minDistance, maxDistance } = this.data; const targetDistanceMod = this.currentDistanceMod + delta; const moddedDistance = this.currentDistance - targetDistanceMod; - if (moddedDistance > maxDistance) { - return false; - } else if (moddedDistance < minDistance) { + if (moddedDistance > maxDistance || moddedDistance < minDistance) { return false; } + this.currentDistanceMod = targetDistanceMod; return true; },