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

separating prefab variants

Discussion in 'Prefabs' started by grobonom, Feb 28, 2019.

  1. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    Hi all.

    I understand the concept of prefab and instance....

    I also understant the concept of prefab variant.

    but....

    i made a prefab from my awesome prefab !!!!

    and i wanna make this variant a BASE prefab. I mean separate it from it's parent prefab and make it evolve and live its life without any overrides !!!

    I agree that changes in parent prefab will be lost in variant but.... it's a child !!! gotta live its life :p

    how can this be done ?
    I red doc and forums and saw nothing about this ( dam* fuc*ing ) simple thing ?

    and am sure u guyz at unity thought about this and allowed it^^

    so ? where can i do this ? :D

    regards and happy unitying !
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    The fastest I can think of is to put an instance of the prefab variant into the scene, unpack it completely, and make a new prefab from it.
     
  3. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    oh ok.... then with prefab unpacking ^^

    thanks @Baste :)
     
  4. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    If I understand the question correctly, you can also go into Prefab Mode of the Variant, and unpack the base Prefab there. This way the Variant is still the same Prefab, so if you have any instances in your scenes, you won't have to replace those with a new Prefab.
     
  5. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Speaking of which ... is there a non-hacky way to replace any scene objects with another prefab or prefab variant?

    For example, let's say I started out prototyping and made copy of some object, have arranged everything well in the scene, and now I realize this should be a prefab. In an ideal world, I'd make one of the objects a prefab, and then drag'n'drop the prefab onto the other game objects (e.g. while holding ALT). Poses, and more importantly, and references from other game objects would stay intact.

    Or, I have a prefab and then realize that there's actually two versions of that prefab, so I create a prefab variant. Again, the challenge is making the existing game objects inherit from that new prefab variant.
     
    jrumps likes this.