Legacy Documentation: Version 5.2
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

NetworkManager.OnMatchCreate

Switch to Manual
public void OnMatchCreate(Networking.Match.CreateMatchResponse matchInfo);

Parameters

matchInfo Info about the match that has been created.

Description

This is invoked when a match has been created.

The default implementation of this starts a host for the match.

class MatchManager : NetworkManager
{
	public virtual void OnMatchCreate(CreateMatchResponse matchInfo)
	{
		if (matchInfo.success)
		{
			StartHost(new MatchInfo(matchInfo));
		}
	}
}