- Home /
Connecting with client causes n+1 players to spawn
Hey guys,
Networking n00b here. I just completed this fantastic tutorial here:
http://www.palladiumgames.net/tutorials/unity-networking-tutorial/
I created the following two scripts:
A player mover script: http://pastebin.com/Zc7eQTSr
An authoritative server script: http://pastebin.com/egUQz8yC
Now, I have 1 question and 1 problem.
The question is: How do I use OnPlayerDisconnected to destroy the player that is instantiated when they join? It's in the server script but it isn't doing anything.
The problem is: If I connect the client to the server, the disconnect it and reconnect it, additional cubes spawn. I could be mistaken, but it seems to be 1, then 3 cubes, then 5 (maybe 4?) cubes. Why is this happening?
Any help would be really fantastic, as I'm still trying to learn this type of programming. Thank you!
Your answer