From c33f10ca1be5f79f1657fa5754379ecb80c3e82b Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Tue, 4 Apr 2017 18:05:46 -0700 Subject: [PATCH] Recenter body on teleport, also it works more consistently. If your avatar happens to be squatting, your body will stand up straight after you teleport. Also, setting MyAvatar.position can sometimes fail due to the multi-threaded nature of scripting. Instead, teleport.js uses goToPosition to move the avatar, as a result teleport feels much more responsive now. --- scripts/system/controllers/teleport.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/system/controllers/teleport.js b/scripts/system/controllers/teleport.js index 90f8ccb368..33c0b3116e 100644 --- a/scripts/system/controllers/teleport.js +++ b/scripts/system/controllers/teleport.js @@ -297,8 +297,9 @@ function Teleporter() { } else if (teleportLocationType === TARGET.SURFACE) { var offset = getAvatarFootOffset(); intersection.intersection.y += offset; - MyAvatar.position = intersection.intersection; + MyAvatar.goToLocation(intersection.intersection, false, {x: 0, y: 0, z: 0, w: 1}, false); HMD.centerUI(); + MyAvatar.centerBody(); } } };