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

public class CameraFollowController : MonoBehaviour
{
    public GameObject FollowPositionObject;
    public GameObject FollowLookAtObject;

    private float _distance;

    void Start()
    {
        _distance = Vector3.Distance(transform.position, FollowPositionObject.transform.position);
    }

    void FixedUpdate()
    {
        UpdateInput();
        Vector3 up = Vector3.Normalize(transform.position - FollowLookAtObject.transform.position);
        transform.position = FollowPositionObject.transform.position + up * _distance;        
        transform.LookAt(FollowLookAtObject.transform.position, FollowPositionObject.transform.forward);
    }

    private void UpdateInput()
    {
        //_distance += Input.GetAxis("RightVert") * 60;
    }
}
