Instantiating player from player id in PUN 2

Hello,
In PUN1 I could do this if I wanted to get the player game object from integer playerID

PhotonPlayer photonPlayer = new PhotonPlayer(true, playerId, "name");
GameObject player = (GameObject)photonPlayer.TagObject;
return player;


But now with Photon.Realtime.Player that's not possible, any ideas?

Comments

  • PUN is creating the Player objects based on who is in the room. You can find each (by ID) and set the tag but you can't create a new Player (or at least it doesn't make a lot of sense).
    Check out the Room class to access players.