- Home /
[UNET] How to know the connectionID of a player ?
Hello,
Here is my problem : I know that you can spawn a prefab with NetworkServer.Spawn() but I don't know how to use properly NetworkServer.AddPlayerForConnection() before, to attribute the object to a player.
So here is my question : how do I know the connectionID of a player to use the AddPlayerForConnection ?
Thank you by advance :)
Answer by seanr · Jul 05, 2015 at 08:08 PM
NetworkServer.AddPlayerForConnection() takes a playerControllerId. This would be zero unless you have more than one player per client.
Answer by isidro02139 · Jul 03, 2015 at 05:39 PM
Natos, I don't know the answer, but at irc.freenode.net in the channel #unity3d-unet there are people who might!
In addition, some resources and code snippets are being gathered here: https://goo.gl/UmBBpM
Best of luck!