Create Match Fails on uint max player count

I’m reliably getting an error when I try to use a reference to set the maximum player count for a match. I tried casting my values to unsigned int which the value calls for but it appears to still not work.

CreateMatchRequest cmr = new CreateMatchRequest();
cmr.name = System.Environment.UserName + " Game";
//Doesn't work
cmr.size = (uint)_gameSettings.PlayerCount; <- int
//Works
cmr.size = 4;
cmr.advertise = true;
cmr.password = "";
cmr.matchAttributes = new Dictionary<string, long>();
networkMatch.CreateMatch(cmr, OnMatchCreate);

Thoughts?

The more I work with the new networking, the more I feel I need to look into using a 3rd party solution like Phonon. I can’t really wait around for UNet to evolve. I wouldn’t mind some input on that either.

What’s the error you get?

That value is also compared against the max players per match value set in the web config page, and the lower of the two is enforced when creating a match. It also needs to be greater than or equal to 2 or the match will not be created.

It’s just a CreateMatchFailed()

There’s more info in that error. If you could take a screenshot if it’s appearing there on the bottom left or grab the text output of the error that would be helpful to diagnose the error you’re seeing. Also, please let me know what version of Unity you’re on.

Also double check that variable you’re assigning size to is at least 2 or greater