Search Unity

NetworkBehaviour class gets disabled???

Discussion in 'Multiplayer' started by Royall, Jun 29, 2015.

  1. Royall

    Royall

    Joined:
    Jun 15, 2013
    Posts:
    120
    I have a controller object with:
    Code (CSharp):
    1. void Awake() {
    2.         DontDestroyOnLoad(transform.gameObject);
    3.     }
    So it remembers settings outside the menu scene...
    When moving on to the world scene the object gets disabled when I use NetworkBehaviour instead of Monobehaviour:
    Code (CSharp):
    1. public class Controller : NetworkBehaviour {
    Code (CSharp):
    1. public class Controller : MonoBehaviour {
    I need NetworkBehaviour cause I want to use: http://docs.unity3d.com/ScriptReference/Networking.NetworkBehaviour-isServer.html to do a simple check...

    What is the problem?

    Edit: Seems like it get's disabled when there is a network identity attached... Problem is I have to attach one will networkbehaviour work... :(
     
    Last edited: Jun 29, 2015
  2. Hacky

    Hacky

    Joined:
    Mar 22, 2013
    Posts:
    28
    JA5PAR likes this.