- Home /
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.
I have the same problem, sans prime31 plugin(I'm writing a custom plugin)
Answer by pdriggett · Aug 26, 2011 at 02:20 PM
Please post the code around Line 1137 so we can see the possible code in question.
It's Unity code -- it's part of the engine itself.
Answer by psneville · Apr 20, 2012 at 01:54 PM
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
Your answer
Follow this Question
Related Questions
Prime31 Gamecenter Crash when triggering method 1 Answer
Unity Social Platform not working correctly? 0 Answers
GameCenter Post Score? 0 Answers
Prime31 GameCenter 2 Answers
Turn off the completion banner for the Achievement in gamecenter prime31 1 Answer