Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Unity Multiplayer Problems Upgrading from Beta - OnServerAddPlayer not being called

Discussion in 'Multiplayer' started by noise256, Jun 10, 2015.

  1. noise256


    Apr 7, 2013
    Hi all,

    Apologies if I'm missing something obvious but a lot of stuff from my project seems to have stopped working since upgrading from 5.1.0b5. In particular, the client ready button on the server is not longer there, (is it not supposed to be?) however, its still there in the example 2Dshooter project.

    All I see on the NetworkManager HUD after clicking LAN Host(H) is:

    My NetworkManager is set up as follows:

    and my NetworkManager script is:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Networking;
    3. using System.Collections.Generic;
    5. public class NetManager : NetworkManager {
    6.     public GameObject worldMaker;
    8.     public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId) {
    9.         GameObject player = (GameObject) Instantiate(base.playerPrefab, transform.position, Quaternion.identity);
    11.         NetworkServer.AddPlayerForConnection(conn, player, playerControllerId);
    12.         GameManager.registerPlayer(player);
    14.         if (!worldMaker.GetComponent<WorldMaker>().started) {
    15.             worldMaker.GetComponent<WorldMaker>().generate();
    16.         }
    17.     }
    18. }
    If I connect with a seperate application instance then there isn't a client ready button there either and OnServerAddPlayer() is never called.
    Last edited: Jun 10, 2015