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

Proper prefab updating of prefabs contained in prefabs

Discussion in 'Wish List' started by DocSWAB, Oct 30, 2007.

  1. DocSWAB

    DocSWAB

    Joined:
    Aug 28, 2006
    Posts:
    615
    I know this has come up before, but I want to tickle this topic and restate my strong desire for this feature.

    In Flash, you create things out of the library. If you nest a Movie Clip from the library in another movie clip, that connection to the library is changed. If you go into the library (or the nested movie clip in a scene) and change it, all instances of that movie clip are updated, instantly.

    But in Unity, if you place a prefab into another prefab, the connection to the prefab in the project is lost and that prefab is now just any other game object. So if you want to change that nested prefab, you have to find all instances of the prefab and manually change it.

    And it is absolutley not the same just to apply changes to the top level prefab -- what if the child prefab is used in several nested prefabs, and you want to change all the children?

    Anyhoo, the current functionality sort of negates the whole notion of modular prefabs and nesting them to create more complex objects. As it stands, you have to unparent them and then put in a bunch more code for the bits to find each other in the hierarchy. Not very friendly or Unity-like.

    I sort of understand that the current implementation makes new prefabs that contain nested prefabs "stable" in the sense that changing the child prefab prefab doesn't change the nested instance. And that has a few advantages.

    But I would argue that the advantages outweigh the drawbacks. Flash deals with this by the "Break Apart" command that detaches a Movie Clip from its library instance and makes it a plain old object again. That would certainly be possible to include as part of making nested prefabs retain their connection to the Project library.

    Thanks for listening. As Unity has matured, some of these little things start to stand out more since the tool is so awesome overall.
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,748
    Second'd.

    In the meantime, I'd recommend an "Instantiate object in my place on startup" script that holds a reference to the sub-prefab, that you can put in to the papa prefab. not very convenient, but it will behave about the same.
     
  3. Factoid

    Factoid

    Joined:
    Mar 30, 2008
    Posts:
    69
    Third'd. Having your visuals vanish because your prefab which contained models scripts had an underlying model change is probably my #1 pet peeve with Unity.
     
  4. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Forth(ith?)
     
  5. sidestepper

    sidestepper

    Joined:
    Oct 2, 2008
    Posts:
    96
    Fifthed'ed?
     
  6. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I was most pleased when I found that this happens in 2.6... Got so used to being able to modify my Maya file AFTER I placed it in a prefab that when I tried to do the same thing in Unity iPhone I got headaches the first time I realised that adding a script to a model means the model is no longer updated when you make a change in Maya...ARGH!

    I haven't tried it in the new Unity iPhone, but I DO hope so...
     
  7. Fove

    Fove

    Joined:
    Feb 15, 2012
    Posts:
    15
    Sixth'd

    can not agreed more
     
  8. DDP

    DDP

    Joined:
    May 17, 2012
    Posts:
    15