mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 11:50:45 +02:00
Disable gravity on script start
This commit is contained in:
parent
8d4dca31c5
commit
b4d3df47fb
1 changed files with 4 additions and 1 deletions
|
@ -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});
|
||||
|
|
Loading…
Reference in a new issue