Hi, my camera does not follow player when my player respawns,, here is the script of camera.

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

public class CameraFollow1 : MonoBehaviour {

public GameObject followObject;
public Vector2 followOffset;
private Vector2 threshold;
public float speed;
private Rigidbody2D rb;
void Start () {
threshold = calculateThreshold();
}

// Update is called once per frame
void FixedUpdate () {
	Vector2 follow = followObject.transform.position;
	float xDifference = Vector2.Distance(Vector2.right * transform.position.x, Vector2.right * follow.x);
	float yDifference = Vector2.Distance(Vector2.up * transform.position.y, Vector2.up * follow.y);

	Vector3 newPosition = transform.position;
	if(Mathf.Abs(xDifference) >= threshold.x){
		newPosition.x = follow.x;
	}
	if(Mathf.Abs(yDifference) >= threshold.y){
		newPosition.y = follow.y;
}
transform.position = Vector3.MoveTowards(transform.position, newPosition, speed * Time.deltaTime);
}
private Vector3 calculateThreshold(){
	Rect aspect = Camera.main.pixelRect;
	Vector2 t = new Vector2(Camera.main.orthographicSize * aspect.width / aspect.height, Camera.main.orthographicSize);
	t.x -= followOffset.x;
	t.y -= followOffset.y;
	return t;
}

private void OnDrawGizmos(){
Gizmos.color = Color.blue;
Vector2 border = calculateThreshold();
Gizmos.DrawWireCube(transform.position, new Vector3(border.x * 2, border.y * 2, 1));
}

}

When your player dies you probably destroy it and instantiate a new one, that also destroys the reference. What you can do is reassign the target when you spawn a new player, this might involve a Find call which is expensive but so is instantiating. What you could do when your player dies is deactivate and then instead of instantiating a new one you just activate the old one, it’s more efficient as well.