From d258c9ed7f53fa4169f330dab652f0b99d99a63d Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 12 Aug 2016 12:59:01 -0700 Subject: [PATCH] pistol adjustments --- scripts/tutorials/entity_scripts/pistol.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/tutorials/entity_scripts/pistol.js b/scripts/tutorials/entity_scripts/pistol.js index 8062de4e8e..73a6daab93 100644 --- a/scripts/tutorials/entity_scripts/pistol.js +++ b/scripts/tutorials/entity_scripts/pistol.js @@ -22,7 +22,7 @@ Controller.Standard.LT, Controller.Standard.RT, ]; - var RELOAD_THRESHOLD = 0.95; + var RELOAD_THRESHOLD = 0.90; Pistol = function() { _this = this; @@ -81,11 +81,11 @@ }, toggleWithTriggerPressure: function() { this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[this.hand]); - + if (this.triggerValue < RELOAD_THRESHOLD) { this.canShoot = true; } - if (this.canShoot === true && this.triggerValue === 1) { + if (this.canShoot === true && this.triggerValue >= RELOAD_THRESHOLD) { this.fire(); this.canShoot = false; } @@ -140,7 +140,7 @@ direction: this.firingDirection }; this.createGunFireEffect(this.barrelPoint) - var intersection = Entities.findRayIntersectionBlocking(pickRay, true); + var intersection = Entities.findRayIntersection(pickRay, true); if (intersection.intersects) { this.createEntityHitEffect(intersection.intersection); if (Math.random() < this.playRichochetSoundChance) {