- Home /
Question by
Chapladeen · Sep 22, 2016 at 04:59 AM ·
c#networkingphoton
Variable Sync across all clients (Photon)
Hi there, i'm currently in the process of working out how to use photon and i've come into a mental wall that I can't seem to get across.
When a player joins a lobby they are meant to get the current amount of players on the server, and then mean to spawn based on that information and then add 1 to the current count.
void OnJoinedRoom() {
//Get current playerCount here
PhotonNetwork.Instantiate (playerPrefabName, spawnPoints[playerCount].position, spawnPoints[playerCount].rotation, 0);
//Return the new playerCount here
}
}
Thanks for any help you may give.
Once i've figured out how to get and pass variables then I should have less problems. Sorry for being dense, just tired and cant work it out.
Comment