Search Unity

UNET Scene Hierarchy & Folders

Discussion in 'UNet' started by Zullar, Aug 31, 2017.

  1. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    So I've been using empty game objects as "Folders" to organize my scenes. (Blue box)

    UnityFolders.png

    This has 2 problems.
    1: Transform.root pulls the folder instead of the object. (This can be worked around)
    2: UNET does not allow networked objects to be in a folder... the NetworkIdentity must be in the root. (No work around?)

    So with a large scene where there's literally 1,000's of objects how do you guys organize your scene objects? Currently I'm just dumping all in the directory and it's a mess! Has anybody found a way to use folders w/ UNET or are they completely incompatible?

    Thanks in advance.
     
  2. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Try Prefabs, which you have, A spawn pool system, then set up spawning scripts. They will end up in your root folder yeah, but only while playing, other than dev you won't care about that when you play.
     
  3. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    That, or have one network identity at the root object. Then have a message manager up there. The scripts that manage game state can be in the sub folders but whenever a RPC or Cmd has to be invoked you call those at the root messageManager. Still a bit dirty but it's one way you could do it.