How to remove players on disconnect or leave room?

Options
Hello,
I'm having trouble removing players when they leave the room or disconnect. Players are being created by the NetworkManager when a new scene is loaded using PhotonNetwork.Instantiate(remotePlayer ...)
For some reason when the player is disconnected, the remotePlayer is not destroyed.
I do see that OnPlayerLeftRoom is being called, but I'm unable to remove the player there because I do not own the player.

I've tried removing the player in two places, one on the NetworkManager, and one on the remotePlayer, and neither work.


public override void OnPlayerLeftRoom(Player otherPlayer)
{

Debug.Log("NetworkPlayerv3: OnPlayerLeftRoom");

if (otherPlayer.ActorNumber == photonView.OwnerActorNr)
{
Debug.Log("PhotonNetwork Destroy Player");
PhotonNetwork.DestroyPlayerObjects(otherPlayer);
PhotonNetwork.Destroy(photonView);
}
}


Part of the problem for me is otherPlayer passed in OnPlayerLeftRoom only contains the ActorNumber and I can't get access to the gameObject or photonView of otherPlayer.

I could try to build a dictionary that connects all photonViews to player ActorNumbers but this seems like a lot to manage and should have a way to do this built in to Photon.

What is the proper way to destroy a player during disconnects or when they leave the room?