Multiplayer lobby setup

Ok guys I need some help please, I have a game and its a multiplayer game, so its relativly set up but I need to make a multiplayer lobby, I have looked for tutorials on this and nothing is heplful enough, could someone please help me or point me to a video where I could learn this. Thanks guys

Check out the progress on my game! https://sites.google.com/site/whitegalaxystudiosltd/the-space-wars

I myself have worked with PUN and think its a great system as it is easy to use… but if you are new, you might run into a bit of problems because of its differences between unity networking. Anyway back to the answer. I will write a code below that you can use. To use it just make a new C# script and modify where is says: MYPREFAB near the bottom with you’re character also make sure its in a resources folder. Make sure you make a gameobject and set it as SpawnSpot and change version to you’re game version(Just so people with older game versions cant connect to people with newer.
if you need more help comment below what you need and i will modify.

I also made a GIF of it in action: alt text

using UnityEngine;
using System.Collections.Generic;
using System.Collections;

public class NetworkManager : MonoBehaviour {
	
	private bool spawn = false;
	private int maxPlayer = 1;
	public GameObject SpawnSpot;
	private Room[] game;
	private string roomName = "DEFAULT ROOM NAME";
	bool connecting = false;
	List<string> chatMessages;
	int maxChatMessages = 5;
	private string maxPlayerString = "2";
	public string Version = "Version 1";
	private Vector3 up;
	private Vector2 scrollPosition;
	
	void Start (){
		PhotonNetwork.player.name = PlayerPrefs.GetString("Username", "My Player name");
		chatMessages = new List<string>();
	}
	
	void OnDestroy(){
		PlayerPrefs.SetString("Username", PhotonNetwork.player.name);
	}
	
	public void AddChatMessage(string m){
		GetComponent<PhotonView>().RPC("AddChatMessage_RPC", PhotonTargets.AllBuffered, m);
	}
	
	[RPC]
	void AddChatMessage_RPC(string m){
		while(chatMessages.Count >= maxChatMessages){
			chatMessages.RemoveAt(0);
		}
		chatMessages.Add(m);
	}
	
	void Connect(){
		PhotonNetwork.ConnectUsingSettings(Version);
	}
	
	void OnGUI(){
		GUI.color = Color.grey;
		if(PhotonNetwork.connected == false && connecting == false ) {
			GUILayout.BeginArea( new Rect(0, 0, Screen.width, Screen.height) );
			GUILayout.BeginHorizontal();
			GUILayout.FlexibleSpace();
			GUILayout.BeginVertical();
			GUILayout.FlexibleSpace();
			
			GUILayout.BeginHorizontal();
			GUILayout.Label("Username: ");
			PhotonNetwork.player.name = GUILayout.TextField(PhotonNetwork.player.name);
			GUILayout.EndHorizontal();
			
			if( GUILayout.Button("Multi Player") ) {
				connecting = true;
				Connect ();
			}
			GUILayout.FlexibleSpace();
			GUILayout.EndVertical();
			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();
			GUILayout.EndArea();
		}
		if(PhotonNetwork.connected == true && connecting == false) {
			GUILayout.BeginArea( new Rect(0, 0, Screen.width, Screen.height) );
			GUILayout.BeginVertical();
			GUILayout.FlexibleSpace();
			
			foreach(string msg in chatMessages) {
				GUILayout.Label(msg);
			}
			
			GUILayout.EndVertical();
			GUILayout.EndArea();
			
		}
		
		if (PhotonNetwork.insideLobby == true) {
			
			GUI.Box(new Rect(Screen.width/2.5f , Screen.height /3f , 400, 550),"");
			GUI.color = Color.white;
			GUILayout.BeginArea (new Rect(Screen.width/2.5f , Screen.height /3 , 400, 500));
			GUI.color = Color.cyan;
			GUILayout.Box ("Lobby");
			GUI.color = Color.white;
			
			GUILayout.Label("Session Name:");
			roomName = GUILayout.TextField(roomName);
			GUILayout.Label ("Max amount of players 1 - 20:");
			maxPlayerString = GUILayout.TextField (maxPlayerString,2);
			if (maxPlayerString != "") {
				
				maxPlayer = int.Parse (maxPlayerString);
				
				if (maxPlayer > 20) maxPlayer = 20;
				if (maxPlayer == 0) maxPlayer = 1;
			}
			else
			{
				maxPlayer = 1;
			}
			
			if ( GUILayout.Button ("Create Room ") ) {
				if (roomName != "" && maxPlayer > 0) {
					PhotonNetwork.CreateRoom(roomName,true,true,maxPlayer);
				}
			}
			
			GUILayout.Space (20);
			GUI.color = Color.yellow;
			GUILayout.Box ("Sessions Open");
			GUI.color = Color.red;
			GUILayout.Space (20);
			
			scrollPosition = GUILayout.BeginScrollView(scrollPosition, false,true,GUILayout.Width(400), GUILayout.Height(300));
			
			
			foreach (RoomInfo game in PhotonNetwork.GetRoomList ())
			{
				GUI.color = Color.green;
				GUILayout.Box (game.name + " " + game.playerCount + "/" + game.maxPlayers + " " + game.visible);
				if ( GUILayout.Button ("Join Session") ) {
					PhotonNetwork.JoinRoom(game.name);
				}
			}
			GUILayout.EndScrollView ();
			GUILayout.EndArea ();
		}
	}
	
	void OnJoinedLobby(){
		Debug.Log("OnJoinedLobby");
	}
	
	void OnPhotonRandomJoinFailed(){
		Debug.Log("OnPhotonRandomJoinFailed");
		PhotonNetwork.CreateRoom( null );
	}
	
	void OnJoinedRoom(){
		Debug.Log("OnJoinedRoom");
		connecting = false;
		spawn = true;
	}
	
	void Update(){
		if(spawn == true){
			spawn = false;
			GameObject MyCharacter = (GameObject)PhotonNetwork.Instantiate("MYPREFAB", SpawnSpot.transform.position, Quaternion.identity, 0);
		}
	}
}

@RavenOfCode
I had this issue too. I had set
isVisible=false;

Please set
isVisible =true;
in RoomOptions. It solved my problem.

@RavenOfCode
I had this issue too. I had set
isVisible=false;

Please set
isVisible =true;
in RoomOptions. It solved my problem.

Do I have to connect to photon network once again if i load another multiplayer scene ? when i am loading scene from scene1 to scene2 , joinlobby is no getting executed. Can you please guide me on this ? I want to have total of 2 multiplyer scene and one starting scene where we create room and stuff. Is there any rule or constrains exist for using photon in difference scene ? I am new to photon.

NetworkManager1.cs(110,20): error CS1502: The best overloaded method match for `PhotonNetwork.CreateRoom(string, RoomOptions, TypedLobby, string)’ has some invalid arguments

Assets/Resources 1/NetworkManager1.cs(110,40): error CS1503: Argument #2' cannot convert bool’ expression to type `RoomOptions’