Search Unity

What are the prefab complexity limits?

Discussion in 'Editor & General Support' started by Dreamwriter, Dec 12, 2016.

  1. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    We have a collection of gameobjects that will not stay as a prefab - if we drag it out of the scene into the project, it gets highlighted as a prefab, but changes don't get applied as a prefab, and next time the scene is loaded it's no longer highlighted as a prefab. It's our hero, a very large, complex thing that has grown over time, with things like the Vive camera rig in it.

    We really want to remake it as a working prefab, so we can work on the hero without changing the scene. We can break it into a few parts and then assemble them when the scene loads, so the question is, how complex can we make it, without this happening again?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Use the "Apply changes to prefab" menu item to do just that. It's not something that happens automatically.

    --Eric
     
  3. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    Yeah, that's what doesn't work, because the prefab is too complex. We have a hero prefab in the scene - if we drag another into the scene, make a change on that other one, and press Apply, the changes do not get applied to the one in the scene. If we drag three of them into the scene, and change one and press Apply, the changes aren't applied to any of the others (though they are applied to the root prefab in the Project). It's the kind of thing you see when you have nested prefabs, though in this case we can't even apply changes to the transform on the root GameObject and apply them to other instances of the prefab.

    So what it means is we can't change the hero prefab without also changing the scene, which is annoying in a source-control environment since scenes don't merge. It also means if we had multiple scenes with that prefab in it we'd have to make the change to the instance in each scene, rather than all at once by only changing the prefab and hitting apply (but we don't have multiple scenes...yet).
     
    Last edited: Dec 12, 2016