**Hi, i have issue with camera follow multi players, i want when each player selected camera folow that and when one of this players destroy camera not follow them. my script work for just one player**

public Transform target;

public float distance = 10.0f;

public float height = 5.0f;

public float heightDamping = 2.0f;

public float rotationDamping = 3.0f;

```
void Update()
{
if(!target.gameObject.active)
this.gameObject.SetActive(false);
}
void LateUpdate ()
{
if (!target)
return;
Vector3 followpos = new Vector3(0.0f, height, -distance);
Quaternion lookrotation = Quaternion.identity;
lookrotation.eulerAngles = new Vector3(10f, 0.0f, 0.0f);
Matrix4x4 m1 = Matrix4x4.TRS(target.position, target.rotation, Vector3.one);
Matrix4x4 m2 = Matrix4x4.TRS(followpos, lookrotation, Vector3.one);
Matrix4x4 combined = m1 * m2;
Vector3 position = combined.GetColumn(3);
Quaternion rotation = Quaternion.LookRotation(
combined.GetColumn(2),
combined.GetColumn(1)
);
Quaternion wantedRotation = rotation;
Quaternion currentRotation = transform.rotation;
Vector3 wantedPosition = position;
Vector3 currentPosition = transform.position;
currentRotation = Quaternion.Lerp(currentRotation, wantedRotation, rotationDamping * Time.deltaTime);
currentPosition = Vector3.Lerp(currentPosition, wantedPosition, heightDamping * Time.deltaTime);
transform.localRotation = currentRotation;
transform.localPosition = currentPosition;
}
```