UNET, not seeing myself when creating a game

Hi, I am trying to create a Lobby using the following code but I do not see myself as joined in to the list of players. I am pressing a button enabling the GameObject containing this script and then calling StartMyMpServer(). What am I doing wrong here?

public class MultiplayerRoom : NetworkLobbyManager
{
    private string selectedChapter = "";    // chapter selected at character selection screen
    public GameObject chapterLister;		// list of chapters
	private NetworkMatch networkMatch;		// NetworkMatch object

	public void StartMyMpServer()
	{
		networkMatch = gameObject.AddComponent<NetworkMatch>();
		CreateMatchRequest create = new CreateMatchRequest();
		create.name = "MS_" + Guid.NewGuid().ToString("N");
		create.size = 2;
		create.advertise = true;
		create.password = "";

		networkMatch.CreateMatch(create, OnMatchCreate);
	}

	public override void OnMatchCreate(CreateMatchResponse matchResponse)
	{
		if (matchResponse.success)
		{
			Debug.Log("Create match succeeded");
			Utility.SetAccessTokenForNetwork(matchResponse.networkId, new NetworkAccessToken(matchResponse.accessTokenString));
			NetworkServer.Listen(new MatchInfo(matchResponse), 9000);
		}
		else
		{
			Debug.LogError("Create match failed");
		}
	}
}

Screenshot:

alt text

I happened to solve this by adding this.StartHost() after networkMatch.CreateMatch(create, OnMatchCreate);. I’m just not sure thats the right way to do this.

Please note: UNET infos are so scarce that I’ll reply to this question even if it’s a bit old.

@Gatau You don’t have to invoke StartHost() at all!

Just delete your custom OnMatchCreate(), the built-in method will take care of everything for you. If you want to run some custom logic after a match is created you can override OnMatchCreate() but you have to make sure to invoke its base implementation too.

public override void OnMatchCreate(CreateMatchResponse createMatchResponse)
{
    base.OnMatchCreate(createMatchResponse);

    if (createMatchResponse.success)
    {
        // Custom logic           
    }
}

I hope somebody will find this reply useful.