Unet- Null refernence OnMatchCreate , only on Iphone build
Whenever, i try to create a match on my iphone build , i get a null reference on OnMatchCreate call back . This doesn't seem to happen on my Andriod or Pc builds and i am able to create matches on them without any errors.
here's the code -
public void CreateMatch(string _name, uint _size){
CreateMatchRequest request = new CreateMatchRequest ();
request.name = _name;
request.size = _size;
request.advertise = true;
request.password = string.Empty;
manager.matchMaker.CreateMatch (request, OnMatchCreate);
roomSize = _size;
manager.isHost =true;
}
public void OnMatchCreate(CreateMatchResponse matchResponse)
{
if (matchResponse.success)
{
Debug.Log("Create match succeeded");
matchIsCreated = true;
Utility.SetAccessTokenForNetwork(matchResponse.networkId, new NetworkAccessToken(matchResponse.accessTokenString));
_matchInfo = new MatchInfo (matchResponse);
MatchCreated = _matchInfo;
manager.StartHost (_matchInfo);
manager.MyMatchInfo = _matchInfo;
}
else
{
Debug.LogError ("Create match failed");
}
}
11/20/2016: fyi since 5.5b+ the above code is obsolete. New code is hard to find >> I have my sort of "megathread" here to help figure this stuff out:
http://answers.unity3d.com/questions/1271635/multiplayer-lobbystagingmatchmaking-flow-quickstar.html
(I found this on Google)
Your answer
![](https://koobas.hobune.stream/wayback/20220612074349im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Object reference not set without object? Calling ListMatches and getting this error 2 Answers
UNet CCU is not cleared 1 Answer
unet and automatic matchmaking. 0 Answers
What does Create Internet Match do? 2 Answers
Custom Matchmaker dont work 0 Answers