- Home /
How can a client connect more players to a network game?
Currently my game can controlled on one keyboard by up to 8 players, without any networking involved. Now I want to extend the game with networking. So let's say 3 players are on the server-client and other 5 players connect from the client.
As far as I know it is possible with UNET that more players connect by the same client. In the network manager I selected the player prefab (which has its network identity) and turned off "Auto Create Player". So I need to create the appropriate number of players myself. Although I can't find the right method for that.
The closest I've found is that I instantiate the object and connect it with the NetworkServer.AddPlayerForConnection()
function. Although it needs a NetworkConnection
type parameter and I can not find in the documentation where can I get its value.
Am I close or does my problem need a totally different approach? How can I connect more players with one client?
Answer by seanr · Aug 26, 2015 at 07:32 PM
ClientScene.AddPlayer()
I won't have time to try this in the next few days, but after checking the documentation I'm sure that this is what I need. Thank you.
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Can a person be both a client and a server? (and more) 0 Answers
Client side Player prefab spawned by overriding GameManager return false for isLocalPlayer 0 Answers
Using AssignClientAuthority 0 Answers
How to synchronize the position of a gameobject over network which is draggable by every player 1 Answer