mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 01:12:48 +02:00
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.
This commit is contained in:
parent
384f404602
commit
c33f10ca1b
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue