Teleport animation

This commit is contained in:
MaddoScientisto 2025-02-22 14:45:46 +01:00
commit 4a8ac7a495
8 changed files with 269 additions and 5 deletions

View file

@ -19,6 +19,8 @@ public partial class LevelTeleporter : Teleporter
_particles.Emitting = true;
await player.Teleport();
await Task.Delay((int)(TeleportAnimationLength * 1000));
GlobalState.Instance.GotoScene(LevelPath);

View file

@ -131,12 +131,17 @@ public partial class Teleporter : Activable
await TweenPlayer(player);
Target.PrepareForReceiving();
_particles.Emitting = true;
await player.Teleport();
await Task.Delay((int)(TeleportAnimationLength * 1000));
Target.PrepareForReceiving();
player.GlobalPosition = Target.GlobalPosition + TeleportOffset;
await player.UnTeleport();
player.RequestMovementDisable(false);
}