fix marble teleporterr teleporting in wrong direction and fix finish animation while gyro

This commit is contained in:
RandomityGuy 2022-12-21 17:30:33 +05:30
parent a6ab184ff9
commit 64c1cbdfe2
2 changed files with 5 additions and 1 deletions

View file

@ -492,7 +492,7 @@ class Marble extends GameObject {
A = gWorkGravityDir.multiply(this._gravity);
if (this.mode == Finish)
A = this.velocity.multiply(-16);
if (currentTime - this.helicopterEnableTime < 5) {
if (currentTime - this.helicopterEnableTime < 5 && this.mode != Finish) {
A = A.multiply(0.25);
}
for (obj in level.forceObjects) {

View file

@ -86,8 +86,12 @@ class TeleportTrigger extends Trigger {
} else {
position = destination.vertices[0].add(new Vector(0, 0, 3)).add(pos); // destination.vertices[0].clone().add(new Vector(0, 0, 3));
}
position.w = 1;
this.level.marble.prevPos.load(position);
this.level.marble.setPosition(position.x, position.y, position.z);
var ct = this.level.marble.collider.transform.clone();
ct.setPosition(position);
this.level.marble.collider.setTransform(ct);
if (this.level.isRecording) {
this.level.replay.recordMarbleStateFlags(false, false, true, false);
}