Always kinda liked applying Lerp to the camera following … gives a more live feel to the entire movement. Did not use deltaTime as interpolation factor since that could lead to Ethan getting out of the camera view.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour {
Transform _cameraArm;
Transform _player;
// Use this for initialization
void Start () {
GameObject maincamera = GameObject.FindGameObjectWithTag("MainCamera");
_cameraArm = maincamera.transform.parent;
_player = GameObject.FindGameObjectWithTag("Player").transform;
}
// Update is called once per frame
void Update () {
}
void LateUpdate()
{
_cameraArm.transform.position = Vector3.Lerp(_cameraArm.transform.position, _player.transform.position, 0.1f);
}
}