From 608fa5869ded09188e65a6603105b7d83b739784 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Fri, 14 Mar 2014 14:51:33 -0700 Subject: [PATCH] Return the legs to the default position when we stop the script. --- examples/crazylegs.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/crazylegs.js b/examples/crazylegs.js index 0daf2275f3..c098758a38 100644 --- a/examples/crazylegs.js +++ b/examples/crazylegs.js @@ -21,3 +21,10 @@ Script.update.connect(function(deltaTime) { MyAvatar.setJointData("joint_L_knee", Quat.fromPitchYawRollDegrees(0.0, 0.0, AMPLITUDE * (1.0 - Math.sin(cumulativeTime * FREQUENCY)))); }); + +Script.scriptEnding.connect(function() { + MyAvatar.clearJointData("joint_R_hip"); + MyAvatar.clearJointData("joint_L_hip"); + MyAvatar.clearJointData("joint_R_knee"); + MyAvatar.clearJointData("joint_L_knee"); +});