Showing the changes to scripts/tutorials/entity_scripts (1 of 1 file). Show all
Unified · Split
| @@ -22,7 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | Controller.Standard.LT, |
| 23 | 23 | Controller.Standard.RT, |
| 24 | 24 | ]; |
| 25 | − var RELOAD_THRESHOLD = 0.95; | |
| 25 | + var RELOAD_THRESHOLD = 0.90; | |
| 26 | 26 | |
| 27 | 27 | Pistol = function() { |
| 28 | 28 | _this = this; |
| @@ -81,11 +81,11 @@ · 52 unmodified lines | ||
| 81 | 81 | }, |
| 82 | 82 | toggleWithTriggerPressure: function() { |
| 83 | 83 | this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[this.hand]); |
| 84 | − | |
| 84 | + | |
| 85 | 85 | if (this.triggerValue < RELOAD_THRESHOLD) { |
| 86 | 86 | this.canShoot = true; |
| 87 | 87 | } |
| 88 | − if (this.canShoot === true && this.triggerValue === 1) { | |
| 88 | + if (this.canShoot === true && this.triggerValue >= RELOAD_THRESHOLD) { | |
| 89 | 89 | this.fire(); |
| 90 | 90 | this.canShoot = false; |
| 91 | 91 | } |
| @@ -140,7 +140,7 @@ · 48 unmodified lines | ||
| 140 | 140 | direction: this.firingDirection |
| 141 | 141 | }; |
| 142 | 142 | this.createGunFireEffect(this.barrelPoint) |
| 143 | − var intersection = Entities.findRayIntersectionBlocking(pickRay, true); | |
| 143 | + var intersection = Entities.findRayIntersection(pickRay, true); | |
| 144 | 144 | if (intersection.intersects) { |
| 145 | 145 | this.createEntityHitEffect(intersection.intersection); |
| 146 | 146 | if (Math.random() < this.playRichochetSoundChance) { |