Hello So, I've been toying around with the network capabilities of Unity for a little while, and decided to finally make something of it - but, now there is a problem.. Whenever one of my players disconnect from the server, the OnPlayerDisconnected(NetworkPlayer netPlayer) does not get called on the server. I've tracked the Network.connections and the player does indeed loose the connection when calling Network.disconnect(). Using OnDisconnectedFromServer(NetworkDisconnection info) does not register the disconnect either. Odd thing is that OnPlayerConnected(NetworkPlayer netPlayer) gets called just fine. The above functions reside inside a public Connection class attached to a gameobject along with a networkView. Am I missing something obvious here? Thanks in advance for any insight you may have.. :] Edit: the title says OnplayerDisconnect() - should have said OnPlayerDisconnected() - just to dismiss the possibility of spelling errors in the script.
Hi Thanks for the info - now I know 2 new things. 1) Networkviews are not required for OnPlayerDisconnected, and... 2) OnPlayerDisconnected is spelled with a /small/ L .. >< And here I was editing to tell everyone it was not a spelling error - lol - Silly fast fingers << Sorry to have wasted your time
You think that's bad - I just had, inside OnPlayerDisconnected, a log message saying: "player has connected!" took me two days to figure out what was wrong