I’m sure I made a mistake in the code :
``using UnityEngine;
using System.Collections;
public class MultyPlayer : MonoBehaviour {
private float buttonXpos=Screen.width/2;
private float buttonYpos=Screen.height/2;
private bool joinedRoom;
private bool createdRoom;
private int numberRooms;
// Use this for initialization
void Start () {
PhotonNetwork.ConnectUsingSettings(“v1.0”);
}
// Update is called once per frame
void Update () {
}
void onJoinedLobby(){
numberRooms=PhotonNetwork.countOfPlayersOnMaster;
if(createdRoom==true){
PhotonNetwork.CreateRoom(null ,false,false ,2);
PhotonNetwork.LoadLevel(“Scene”);
}
if(joinedRoom == true){
PhotonNetwork.JoinRandomRoom();
PhotonNetwork.Instantiate(“Sphere_prefab”, new Vector3(0,0,0),
Quaternion.identity, 0);
}
}
//User Interface
void OnGUI() {
if(GUI.Button(new Rect (buttonXpos , buttonYpos , 160 , 40) , "Connect to a room " + numberRooms)){
joinedRoom=true;
}
if(GUI.Button (new Rect (buttonXpos , buttonYpos+40 , 160 , 40), “Create Game” )){
createdRoom=true;
}
}
}
I have two buttons one to create a game and one to join.In the Join game button it should display how many players are connected to the master server but it keeps showing me 0 even when I’m there.So I don’t know if I connected to the server , it seems something is wrong.Any suggestions ?