- Home /
How much players are in scene
do you know how can I get the number of players in a specific scene? I'm using Unity Photon's PUN 2, so, almost anything of PUN 1 won't work. Thanks.
Comment
For anyone who is interested, we have the same discussion here.
Answer by Favouriteless · Nov 15, 2018 at 01:41 PM
You'd have to give all players a certain tag then use a method like this.
int FindPlayers () {
GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
int playerNumber = players.Length;
return playerNumber;
}
Your answer
Follow this Question
Related Questions
Custom Properties, Unity, Object refence not set to an instance of an object 0 Answers
Player Won't Instantiate with Photon Unity Network [PUN] 0 Answers
I am developing a PUN Realtime project. I am having issues with players joining room. 0 Answers
Unity 2018 PUN 2 Error 0 Answers
Photon PUN 2 Not working 1 Answer