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

    noise256

    Joined:
    Apr 7, 2013
    Posts:
    22
    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:

    http://gyazo.com/bdd470b298fca7b0717b892c5a4fd9ed

    My NetworkManager is set up as follows:

    http://gyazo.com/141ae1de568c38ce00398021bc48a934

    and my NetworkManager script is:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Networking;
    3. using System.Collections.Generic;
    4.  
    5. public class NetManager : NetworkManager {
    6.     public GameObject worldMaker;
    7.  
    8.     public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId) {
    9.         GameObject player = (GameObject) Instantiate(base.playerPrefab, transform.position, Quaternion.identity);
    10.  
    11.         NetworkServer.AddPlayerForConnection(conn, player, playerControllerId);
    12.         GameManager.registerPlayer(player);
    13.  
    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