OnClientConnect

I’m new to Netcode for gameobjects. I wanted to know if there is an event or method which is called on the server when a new Client connects to the game. so that we can do some initial setup for that Client

Hey, I know it’s late but maybe it can help somebody else, you can subscribe to the event in the NetworkManager singleton like so.

public class GameManager : NetworkBehaviour
    {
        private void OnClientConnected(ulong clientId)
        {
            print("Client connected with id: " + clientId);
        }
        public override void OnNetworkDespawn()
        {
            base.OnNetworkDespawn();

            if (IsServer)
            {
                NetworkManager.Singleton.OnClientConnectedCallback -= OnClientConnected;
            }
        }
        public override void OnNetworkSpawn()
        {
            if(IsServer)
            {
                NetworkManager.Singleton.OnClientConnectedCallback += OnClientConnected;
            }
        }
}