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

public class CameraMove : MonoBehaviour
{
    private GameObject player;
    public float smoothing;

    private void Awake()
    {
        player = GameObject.FindGameObjectWithTag("Player");
    }

    void LateUpdate()
    {
        if (transform.position != player.transform.position)
        {
            Vector2 position = Vector2.Lerp(transform.position, player.transform.position, smoothing);
            transform.position = new Vector3(position.x, position.y, transform.position.z);
        }
    }
    
}

