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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Network Lobby Example having NetworkIdentity on child objects

Discussion in 'Multiplayer' started by WaitYes, Mar 24, 2018.

  1. WaitYes

    WaitYes

    Joined:
    Sep 5, 2016
    Posts:
    11
    In the documentation it says that "the NetworkIdentity must be on the root of the hierarchy" but in the Network Lobby Example, when the player object is spawned, it is a child object with a NetworkIdentity. How does that work?
     
  2. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,221
    Nice. The ol' Unity magic, right there. You got to witness it first hand, my friend. I envy you.
     
  3. Driiade

    Driiade

    Joined:
    Nov 21, 2017
    Posts:
    80
    On the root of the prefab* is more accurate.
     
  4. WaitYes

    WaitYes

    Joined:
    Sep 5, 2016
    Posts:
    11
    Sorry it took me so long to reply Driiade. You are very right about the Network Identity being on the root of the player prefab. The instantiated player than is made a child of Player List, which has Lobby Manager as the highest level parent. This is similar to instantiated players being made children of the start position. I still don't know how the player object is instantiated as a child object, and why this wouldn't cause trouble with Network Identity

    The reason I didn't respond early is that this is now causing me some problems, which I am going to make a new post about because it is a whole new category of error.