Bug in camera

so basically i have a camera set for my player and it works when i'm alone in the room but when i join with two players in the room it stop working and when i leave it works again. here's my code.

public class cam : MonoBehaviour


  public Transform player;

  public Vector3 cameraOffset;

  public float cameraSpeed = 0.1f;

  void Start()


    transform.position = player.position + cameraOffset;

    player = transform.Find("PlayerTest").GetComponent<Transform>();


  void Update()


      Vector3 finalPosition = player.position + cameraOffset;

      Vector3 lerpPosition = Vector3.Lerp(transform.position, finalPosition, cameraSpeed);

      transform.position = lerpPosition;