Search Unity

What happens when we click "Apply prefab" if they're nested?

Discussion in 'Editor & General Support' started by zhuchun, Oct 23, 2016.

  1. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Hi, I'm confusing about nested prefab's saving problem. For example, I have a character with a gun and a knife like this.

    --Character(prefab)
    --|--Gun(prefab)
    --|--Knife

    Say I saved character and gun as separately prefabs, then set gun.ammo + 1 and character.hp - 1.
    Then is there any difference between clicking "Apply prefab" on character and gun?
     
  2. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    There is currently no concept of nested prefabs in unity. If I recall correctly, pressing apply in a child, will actually apply the highest level prefab. Any children that are prefabs, lose their connections and become part of the higher one.
     
    zhuchun and DroidifyDevs like this.
  3. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    That's correct. I really wish Unity had a feature for nested prefabs :(
     
  4. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Thanks @zombiegorilla :)
    No wonder I lost prefabs when applied them sometimes. What an error prone design :(
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    They're prototyping nested prefabs now! Check out the roadmap.

    From what was said at last Unity, Unity's committed to making it, but the timeline is still not certain.
     
    DroidifyDevs likes this.