using System.Collections;
using System.Collections.Generic;
using Assets._game.scripts;
using UnityEngine;

public class TrainingCamera : MonoBehaviour
{
    public Transform followTarget;
    public Vector3 targetOffset;
    public float moveSpeed;
    public Transform cameraTransform;

    void Start()
    {
        if (GameManager.Instance)
        {
            Destroy(gameObject);
            return;
        }
        cameraTransform = transform;
    }

    private void LateUpdate()
    {
        if (followTarget != null)
        {
            cameraTransform.position = Vector3.Lerp(cameraTransform.position, followTarget.position + targetOffset, moveSpeed * Time.deltaTime);
        }
    }
}
