Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

It takes time when I re-enter the same game-room

$
0
0
I am developing a Unity game app with PUN.
My problem is... at first, two players are OK with getting into the game. However, when one of them gets out (using PhotonNetwork.LeaveRoom()) and tries to re-enter the same game-room (using PhotonNetwork.JoinRoom(room name)), it takes a while. And it takes longer as you try again. Sometimes it doesn't even move at all.
Please help me. The source code about entering the game_room is here...
I am using Unity 2017.3.1f1. Thanks.
-------------------------------------------------------------
public void PlayGame() {
foreach(RoomInfo ri in PhotonNetwork.GetRoomList()) {
if (ri.PlayerCount < ri.MaxPlayers) {
PhotonNetwork.JoinRoom(ri.Name);
break;
}
}
}

void OnJoinedRoom() {
...
StartCoroutine(Battle_Scene());
}

IEnumerator LoadBattleField() {
PhotonNetwork.isMessageQueueRunning = false;
AsyncOperation ao = SceneManager.LoadSceneAsync("Battle_Scene");
yield return ao;
}



Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>