PlayerLoop called recursively!

My game was working fine and now when I start up a multiplayer match over game center and load my other scene, the game crashes with the following crash log:

PlayerLoop called recursively!

(Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/Misc/Player.cpp Line: 1137)

PlayerLoop called recursively!

(Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/Misc/Player.cpp Line: 1137)

PlayerLoop called recursively!

(Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/Misc/Player.cpp Line: 1137)

Anyone know how to fix this? I am using prime31’s GameCenter plugin, if that matters.

EDIT: I found out where it was occurring… I was calling:

Application.LoadLevel(“MYSCENE”);

and in the Start() function for that scene I was sending a message:

GameCenterMultiplayerBinding.sendMessageToPeers(oppPlayers, “Game Controller”, “packetReceived”, param,true);

… if the other player doesn’t load at EXACTLY the same time, the SENDING player gets the error. Very strange.

Please post the code around Line 1137 so we can see the possible code in question.

I had the same problem, and found this in Unity’s iOS troubleshooting docs which resolved it:

“PlayerLoop called recursively!” error occurs when using Cocoa via a native function called from a script

Some operations with the UI will result in iOS redrawing the window immediately (the most common example is adding a UIView with a UIViewController to the main UIWindow). If you call a native function from a script, it will happen inside Unity’s PlayerLoop, resulting in PlayerLoop being called recursively. In such cases, you should consider using the performSelectorOnMainThread method with waitUntilDone set to false. It will inform iOS to schedule the operation to run between Unity’s PlayerLoop calls.

This is an excerpt from: http://unity3d.com/support/documentation/Manual/TroubleShooting.html