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);