Get player gameobjects in a room as soon as you join it.

Options
Creating a new discussion as i'm not able to get my head around with the existing solutions. So I have a camera script that takes into account all the players in the room and positions in such a way that all the player gameobjects can be seen at any given time. For that, my camera script needs all the player gameobjects currently present in the game as soon as the player joins the room.

Now let's say i'm the second player that joins the room, the PhotonNetwork.playerList shows there are 2 players already in the room in my OnJoinedRoom() function. But when I try to get all the player gameobjects by using FindObjectsOfType<PhotonView>(), I only get my player and not the first players gameobject (unless I keep a delay of few seconds, which is a solution i'm not willing to use.) As I see from logs, I need to wait for Photons RegisterPhotonView() function to be called in order for me to get the other gameobjects.

Is there any other way? Any help would be greatly appreciated.

Thanks

Comments