From cea2e0fafdd9dec22abb4ee6fd1f26d3a93b6fd6 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 9 Nov 2015 14:21:14 -0800 Subject: [PATCH] don't force location in continueNearGrab --- examples/baseball/bat.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/baseball/bat.js b/examples/baseball/bat.js index c7e3d8ebfb..a4509c53d8 100644 --- a/examples/baseball/bat.js +++ b/examples/baseball/bat.js @@ -14,18 +14,26 @@ Script.include("pitching.js"); (function() { var pitchingMachine = null; - this.startNearGrab = this.continueNearGrab = function() { - // send the avatar to the baseball location so that they're ready to bat - MyAvatar.location = "/baseball" - + this.pitchAndHideAvatar = function() { if (!pitchingMachine) { pitchingMachine = getOrCreatePitchingMachine(); Script.update.connect(function(dt) { pitchingMachine.update(dt); }); } pitchingMachine.start(); MyAvatar.shouldRenderLocally = false; + } + + this.startNearGrab = function() { + // send the avatar to the baseball location so that they're ready to bat + MyAvatar.location = "/baseball" + + pitchAndHideAvatar() }; + this.continueNearGrab = function() { + pitchAndHideAvatar() + } + this.releaseGrab = function() { if (pitchingMachine) { pitchingMachine.stop();