NEWB: Cant Join Room
Options
Hi there,
I am following aling with the MarcoPolo tutorial. I have set it up to the point where I am automatically joined to the Lobby. This works, but nothing past.
Please see code, why am I not able to create and join a room?
using UnityEngine;
using System.Collections;
using Photon;
public class RandomMatchmaker : Photon.PunBehaviour {
// Use this for initialization
void Start () {
PhotonNetwork.ConnectUsingSettings("0.1");
PhotonNetwork.logLevel = PhotonLogLevel.Full;
}
void OnGUI(){
GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
}
public void OnJoinLobby(){
Debug.Log("**OnJoinedLobby()");
PhotonNetwork.JoinRandomRoom();
}
public void OnPhotonRandomJoinFailed(){
Debug.Log("**Cant join room!");
PhotonNetwork.CreateRoom(null);
}
public void OnJoinedRoom(){
GameObject monster = PhotonNetwork.Instantiate("monsterprefab", Vector3.zero, Quaternion.identity, 0);
}
}
I am following aling with the MarcoPolo tutorial. I have set it up to the point where I am automatically joined to the Lobby. This works, but nothing past.
Please see code, why am I not able to create and join a room?
using UnityEngine;
using System.Collections;
using Photon;
public class RandomMatchmaker : Photon.PunBehaviour {
// Use this for initialization
void Start () {
PhotonNetwork.ConnectUsingSettings("0.1");
PhotonNetwork.logLevel = PhotonLogLevel.Full;
}
void OnGUI(){
GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
}
public void OnJoinLobby(){
Debug.Log("**OnJoinedLobby()");
PhotonNetwork.JoinRandomRoom();
}
public void OnPhotonRandomJoinFailed(){
Debug.Log("**Cant join room!");
PhotonNetwork.CreateRoom(null);
}
public void OnJoinedRoom(){
GameObject monster = PhotonNetwork.Instantiate("monsterprefab", Vector3.zero, Quaternion.identity, 0);
}
}
0
Comments
-
Hi @Renman3000,
Please make sure to setAutoJoinLobby
flag to true in settings if you want to join lobby as soon as connected. Otherwise please manually join lobby when connected to MasterServer.
If this still does not fix your issue please post the logs.0