Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

who owns a networkview?

Discussion in 'Multiplayer' started by psx, Feb 18, 2008.

  1. psx

    psx

    Joined:
    Aug 25, 2005
    Posts:
    80
    if you attach a networkView component to a GO in the editor, who owns it? In my experience it seems like nobody? So is it good practice to only use network views with prefabs that get instantiated at runtime?

    Psx
     
  2. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I think in most cases (maybe in all cases), the owner is the server.

    Jashan
     
  3. psx

    psx

    Joined:
    Aug 25, 2005
    Posts:
    80
    If it were "in most cases" - what would be the determining factor? It doesn't seem to be in all cases as far as I've been able to see.

    psx
     
  4. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    277
    All Network Views which are in a scene in the Editor are owned by the server. They get the name "Scene ID: 1" and so on if you print the View ID of those Network Views (or look at it in the inspector). When you allocate a View ID ("Allocated ID: 1", etc) and assign it to a Network View, then that Network View is owned by the one who did the allocation. This can be both a server or a client, they have it in common that they are runtime generated.
     
  5. psx

    psx

    Joined:
    Aug 25, 2005
    Posts:
    80
    Thanks Larus!
    psx