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

public class CameraFollow : MonoBehaviour
{
    [SerializeField] private Transform m_followTarget = default;
    [SerializeField] private float m_followSpeed = 0.1f;
    [SerializeField] private float m_rotateSpeed = 0.1f;
    [SerializeField] private bool m_rotation = false;
    [SerializeField] private bool m_forward = false;

    private void FixedUpdate()
    {
        transform.position = Vector3.MoveTowards(transform.position, m_followTarget.position, m_followSpeed);
        if(m_rotation) transform.rotation = Quaternion.RotateTowards(transform.rotation, m_followTarget.rotation, m_rotateSpeed);
        if(m_forward) transform.forward = Vector3.MoveTowards(transform.forward, m_followTarget.forward, m_rotateSpeed);
    }
}
