December 2013
Beginner
242 pages
4h 23m
English
In Unity Networking, we had to develop our own way to make sure each player was running on the same level, via RPCs, disabling the network queue, waiting for the load to finish, and so on.
In Photon, this problem is significantly easier to solve. You simply set PhotonNetwork.automaticallySyncScene to true, and to load a level call PhotonNetwork.LoadLevel on the master client. For example, we can modify our lobby example to automatically sync the scene between players in a room.
Firstly, in Start we would enable automatic level syncing:
void Start()
{
// ...
// ensure that all players play on the same map
PhotonNetwork.automaticallySyncScene = true;
}Then, when starting a game, we use PhotonNetwork's load level replacement ...
Read now
Unlock full access