diff --git a/Source/Actors/Player.cs b/Source/Actors/Player.cs index 570214b7..8d02ed37 100644 --- a/Source/Actors/Player.cs +++ b/Source/Actors/Player.cs @@ -142,6 +142,7 @@ private enum Events { Land }; private record struct CameraOverride(Vec3 Position, Vec3 LookAt); private CameraOverride? cameraOverride = null; private Vec3 cameraOriginPos; + private Vec3 cameraDestinationPos; private float tCoyote; private float coyoteZ; @@ -474,7 +475,7 @@ public override void LateUpdate() GetCameraTarget(out lookAt, out cameraPos, out _); } - World.CameraDestPos = cameraPos; + cameraDestinationPos = cameraPos; World.Camera.Position += (cameraPos - World.Camera.Position) * (1 - MathF.Pow(0.01f, Time.Delta)); World.Camera.LookAt = lookAt; @@ -608,7 +609,7 @@ private Vec2 RelativeMoveInput // instead of World.Camera.Position. This allows the player to keep going // in the same direction (not slightly shifted left/right), even though // the camera always tries to be "ahead" of the player. - var cameraForward = (World.Camera.LookAt - World.CameraDestPos).Normalized().XY(); + var cameraForward = (World.Camera.LookAt - cameraDestinationPos).Normalized().XY(); if (cameraForward.X == 0 && cameraForward.Y == 0) forward = targetFacing; diff --git a/Source/Scenes/World.cs b/Source/Scenes/World.cs index c9915c53..43320a87 100644 --- a/Source/Scenes/World.cs +++ b/Source/Scenes/World.cs @@ -43,9 +43,6 @@ public enum EntryReasons { Entered, Returned, Respawned } private float strawbCounterEase = 0; private int strawbCounterWas; - // the position that the camera follows - public Vector3 CameraDestPos; - private bool IsInEndingArea => Get() is {} player && Overlaps(player.Position); private bool IsPauseEnabled {