From f6c888599ecbbaa670ce8d8870511ddf64473e76 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Fri, 2 Oct 2015 10:22:48 -0700 Subject: [PATCH] Fixed a bug where particles weren't moving with can. --- examples/toys/sprayPaintCan.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/toys/sprayPaintCan.js b/examples/toys/sprayPaintCan.js index 5c524a38bc..e0aeb19995 100644 --- a/examples/toys/sprayPaintCan.js +++ b/examples/toys/sprayPaintCan.js @@ -99,7 +99,7 @@ this.sprayInjector = Audio.playSound(this.spraySound, { position: position, - volume: 0.1, + volume: this.sprayVolume, loop: true }); @@ -136,16 +136,21 @@ position: position, emitOrientation: forwardQuat, }); - this.sprayInjector.setOptions({position: position}); + this.sprayInjector.setOptions({ + position: position, + volume: this.sprayVolume + }); } this.preload = function(entityId) { + this.sprayVolume = 0.1; this.spraying = false; this.entityId = entityId; this.resetKey = "resetMe"; } + this.unload = function() { if (this.paintStream) { Entities.deleteEntity(this.paintStream);