really weird error - parameter must be of type: <NOTHING>

What could cause this error?

Script error: OnPlayerDisconnected
This message parameter has to be of type: 
The message will be ignored.

I’m using prime31’s GameCenter plugin - and trying to register with the playerDisconnected event, using this function:

GameCenterMultiplayerManager.playerDisconnected += OnPlayerDisconnected;

public void OnPlayerDisconnected (string playerID) {
	// test here
	networkPlayerConnected = false;
	iTween.MoveTo(rematchButton, new Vector3(49.16f, -29.29f, -36.63f), 1);
}

Don't you have to pass a string into the function?

Hi,guys. I'm using Prime31's Game Center plugin and have the same problem like you.I don't know what wrong with it.Did you fix it?

2 Answers

2

HI,guys. The one thing you should know is Unity3d will call OnPlayerDisconnected,OnPlayerConnected function at UnityEngine.Network.
This meaning rename your function will fix this problem. You can rename it like OnUserDisconnected.
Its can give you help.

that was the right answer for me, thanks

That doesn’t look like a correct function call.
For a start, OnPlayerDisconnected returns void, and you’re instead summing its “result” to playerDisconnected.
Additionally, you’re making the call without the ‘playerID’ parameter.
Lastly, given the code, you probably just need to call

OnPlayerDisconnected(yourplayervariablehere);

rather than assign its results somewhere;

No, it was correct. Turns out some setting were wrong.