Different Prefab for each player NetCode

Yep, you call it too soon. Don’t follow up your networkController.MP_Client() call up immediately by globalPlayerManager.MP_InitClientPlayer(), because the server won’t have set up your connection yet. Instead, do the globalPlayerManager.MP_InitClientPlayer() call only when the connection has completed, either through a NetworkManager.Singleton.OnClientConnectedCallback or, as I suggested previously, by doing the InitClientPlayer call in an OnNetworkSpawn, in the spawner object’s code for example. E.g.:

public override void OnNetworkSpawn() {
    if (IsServer)
        MP_CreatePlayerServerRpc(NetworkManager.Singleton.LocalClientId,0);
    else
        MP_CreatePlayerServerRpc(NetworkManager.Singleton.LocalClientId,1);
}
7 Likes