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

public class CameraManager : MonoBehaviour
{
    public Transform cameraTarget;
    public float smoothSpeed = 0.125f;
    public Vector3 cameraOffset;

    private Vector3 desiredPosition;
    private Vector3 smoothedPosition;

    private void FixedUpdate()
    {
        desiredPosition = cameraTarget.position + cameraOffset;
        smoothedPosition = Vector3.Lerp(transform.position, desiredPosition, smoothSpeed);
        transform.position = smoothedPosition;
    }
}
