diff --git a/Assets/Scripts/CameraControl.cs b/Assets/Scripts/CameraControl.cs index 2bc2d87..a36dc31 100644 --- a/Assets/Scripts/CameraControl.cs +++ b/Assets/Scripts/CameraControl.cs @@ -8,7 +8,7 @@ public class CameraControl : MonoBehaviour { private GameObject followThis; void Start() { - Camera.main.orthographicSize = 6; + Camera.main.orthographicSize = 5; if ( followThis == null ) return; } @@ -18,10 +18,8 @@ public class CameraControl : MonoBehaviour { return; var target = followThis.transform.position; var targetVec = target - transform.position; - targetVec.z = 0; - Camera.main.orthographicSize = 6 + targetVec.sqrMagnitude * 10; + targetVec.Scale(new Vector3(0.05f, 0.05f, 0)); transform.position = transform.position + targetVec; - targetVec.Scale(new Vector3(0.05f, 0.05f, 0)); } public void SetFollow(GameObject g) { diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index 9bf3273..34e3402 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -32,6 +32,7 @@ public class PlayerMovement : MonoBehaviour { return; Vector3 speedVec = new Vector3(rb.velocity.x, rb.velocity.y, 0); + Camera.main.orthographicSize = Camera.main.orthographicSize * 0.95f + (5 + 4f/6f * (speedVec.magnitude)) * 0.05f; float speed = speedVec.magnitude; { // Forward