From b4d3df47fbfd89cb9bfc897b6846aa069588dba5 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 1 May 2014 12:09:34 -0700 Subject: [PATCH] Disable gravity on script start --- examples/swissArmyJetpack.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/swissArmyJetpack.js b/examples/swissArmyJetpack.js index fb4dc1dc04..4cb68e9b64 100644 --- a/examples/swissArmyJetpack.js +++ b/examples/swissArmyJetpack.js @@ -178,6 +178,10 @@ function disableArtificialGravity() { MyAvatar.motionBehaviors = MyAvatar.motionBehaviors & ~AVATAR_MOTION_OBEY_LOCAL_GRAVITY; updateButton(3, false); } +// call this immediately so that avatar doesn't fall before voxel data arrives +// Ideally we would only do this on LOGIN, not when starting the script +// in the middle of a session. +disableArtificialGravity(); function enableArtificialGravity() { // NOTE: setting the gravity automatically sets the AVATAR_MOTION_OBEY_LOCAL_GRAVITY behavior bit. @@ -276,7 +280,6 @@ function update(deltaTime) { } Script.update.connect(update); - // we also handle click detection in our mousePressEvent() function mousePressEvent(event) { var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y});