I decided to make smoother camera using interpolation, but it ended up being worse than simple cam.pos = player.pos.
Here goes the code and the video of “stuttering” in the movement after certain distance traveled. What am i doing wrong?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour {
// Use this for initialization
[SerializeField] private Transform target;
void Start () {
}
void LateUpdate()
{
transform.position = Vector3.Lerp(transform.position, target.position, 0.1f);
}
}