diff --git a/scripts/system/controllers/squeezeHands.js b/scripts/system/controllers/squeezeHands.js index 9fdb359b25..f549f911c9 100644 --- a/scripts/system/controllers/squeezeHands.js +++ b/scripts/system/controllers/squeezeHands.js @@ -19,6 +19,8 @@ var CONTROLLER_DEAD_SPOT = 0.25; var TRIGGER_SMOOTH_TIMESCALE = 0.1; var OVERLAY_RAMP_RATE = 8.0; +var animStateHandlerID; + function clamp(val, min, max) { return Math.min(Math.max(val, min), max); } @@ -33,8 +35,10 @@ function lerp(a, b, alpha) { function init() { Script.update.connect(update); - MyAvatar.addAnimationStateHandler(animStateHandler, ["leftHandOverlayAlpha", "rightHandOverlayAlpha", - "leftHandGraspAlpha", "rightHandGraspAlpha"]); + animStateHandlerID = MyAvatar.addAnimationStateHandler( + animStateHandler, + ["leftHandOverlayAlpha", "rightHandOverlayAlpha", "leftHandGraspAlpha", "rightHandGraspAlpha"] + ); } function animStateHandler(props) { @@ -72,7 +76,7 @@ function update(dt) { function shutdown() { Script.update.disconnect(update); - MyAvatar.removeAnimationStateHandler(animStateHandler); + MyAvatar.removeAnimationStateHandler(animStateHandlerID); } Script.scriptEnding.connect(shutdown); diff --git a/unpublishedScripts/DomainContent/Home/whiteboard/swiper.js b/unpublishedScripts/DomainContent/Home/whiteboard/swiper.js index cd19c6eeee..555224e2b6 100644 --- a/unpublishedScripts/DomainContent/Home/whiteboard/swiper.js +++ b/unpublishedScripts/DomainContent/Home/whiteboard/swiper.js @@ -18,11 +18,22 @@ busy: false, preload: function(entityID) { this.entityID = entityID; + Entities.editEntity(entityID, { + userData: JSON.stringify({ + grabbableKey: { + grabbable: false, + wantsTrigger: true + } + }) + }); Script.update.connect(this.update); }, clickReleaseOnEntity: function() { this.createSupplies(); }, + startFarTrigger: function() { + this.createSupplies(); + }, update: function() { if (_this.busy === true) { return; @@ -45,7 +56,6 @@ }, 2000) } }, - createSupplies: function() { var myProperties = Entities.getEntityProperties(this.entityID);