Search Unity

Network functions not working properly

Discussion in 'Multiplayer' started by tookydo, Aug 26, 2014.

  1. tookydo

    tookydo

    Joined:
    Jul 15, 2014
    Posts:
    75
    I have a function in the game scene and it is:

    function OnPlayerConnected(player : NetworkPlayer)
    {
    Debug.Log("Player has connected");
    }

    The function never gets called. What am I doing wrong?
     
  2. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    Is the function located in a script that is attached to a GameObject in the scene?
     
  3. tookydo

    tookydo

    Joined:
    Jul 15, 2014
    Posts:
    75
    Yes it is. I even copy and pasted the code from the documentation and it still didn't work.
     
  4. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    hmmm, very odd. What if you create a new project?