#Clients connecting & disconnecting
3 messages · Page 1 of 1 (latest)
well originally I was getting the player name via conn.identity.GetComponent<Player>(); but I think I need a new approach. Basically I'm wanting to know when a player joins or leaves and know the players name.
If its like a authentication, you could do it over the Authentication process and assign the name as customData on the NetworkConnection. Alternatively, you can listen to SceneManager.OnStartSceneLoaded or something like that called, then you spawn the player with the name and can get it over NetworkConnection.FirstObject. Also you could do a Broadcast as soon as he connects and is authenticated, to send you the name, the same for leaving