Photon Server: Loading Unity Scenes
Options
Hi,
First post, so I apologize if I am not asking the right things. I am trying to use self hosting Photon Server with Unity and I came across a problem. I have a main menu which allows the players to create and join games. It is a 2 player game, so when I get both clients in the same room, the first person who entered (the "host") can start the game. When they do so, they load a level using Unity's Application.LoadLevel and sends an event message for the other player to load the same level.
Right now the game does nothing, I just wanted to test the Networking with a side project. They can leave the game, which loads the main menu again. However, when I do so, the players experience something weird. My GUI is all messed up and it seems that Unity is debugging that I cannot join a game because I am disconnected. Apparently I am connecting. On my GUI I am showing the LitePeer.PeerState and it shows connected. I was just wondering if someone can give me some direction into what is going on. I am very new to Network Programming and finding it to be a very complex area. Any help is appreciated.
Cheers.
First post, so I apologize if I am not asking the right things. I am trying to use self hosting Photon Server with Unity and I came across a problem. I have a main menu which allows the players to create and join games. It is a 2 player game, so when I get both clients in the same room, the first person who entered (the "host") can start the game. When they do so, they load a level using Unity's Application.LoadLevel and sends an event message for the other player to load the same level.
Right now the game does nothing, I just wanted to test the Networking with a side project. They can leave the game, which loads the main menu again. However, when I do so, the players experience something weird. My GUI is all messed up and it seems that Unity is debugging that I cannot join a game because I am disconnected. Apparently I am connecting. On my GUI I am showing the LitePeer.PeerState and it shows connected. I was just wondering if someone can give me some direction into what is going on. I am very new to Network Programming and finding it to be a very complex area. Any help is appreciated.
Cheers.
0
Comments
-
Have a look at the console output. Sometimes there are errors. You can also increase the logging of the library to get more info.
When you load a level, unity will not call Update(). This might break a connection unless you do call SendOutgoingCommands in a Thread. Maybe a coroutine is also fine for that.
Which client SDK do you use? PUN or the plain API from our download page?
You can have another look at our demos. I think in the SDK there is none but in the PUN package, we have a demo that switches scenes.0