using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraFollower : MonoBehaviour
{
    public static CameraFollower instance;
    void Awake(){
        instance = this;
    }
    public float Xsmoothness =1f;
    public float Ysmoothness =1f;
    public static Transform Target;
    void Update()
    {
    }

    public static void UpdateFrame(){
        instance.updateFrame();
    }


    void updateFrame(){
        float newX = Mathf.Lerp(transform.position.x, Target.position.x, Xsmoothness);
        float newY = Mathf.Lerp(transform.position.y, Target.position.y, Ysmoothness);
        transform.position = new Vector3(newX, newY, transform.position.z);
    }
}
