Simple follow camera:
using UnityEngine;
public class CameraFollow : MonoBehaviour
{
[SerializeField]
private Transform target;
[SerializeField]
private Vector3 offset;
void LateUpdate()
{
transform.position =
target.position + offset;
}
}
LateUpdate is commonly useful because the target has usually already moved for that frame.