Search Unity

REGRESSION: re-rooting a prefab is not allowed (1092343)

Discussion in 'Prefabs' started by laurentlavigne, Oct 19, 2018.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    repros:
    make a prefab
    create empty GO
    parent prefab to GO
    drag and drop the hierarchy to the prefab in project
    = "cycle error"
    used to be and should be = "do you want to overwrite the prefab?"
     
  2. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    So now we can't change the root of a prefab.
     
  3. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    Yes, you are creating cyclic nesting when you do this.

    The only way to do this now is to unpack the Prefab instance in the hierarchy before you try to replace the Prefab asset.
     
  4. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    This is a pretty major regression in the way prefab works.
    There is an alternative that allows to preserve what you are tying to do: detect if the target prefab is in the hierarchy, then display a message asking if I want to replace the prefab from the root down. No cycle problem.
     
    Lars-Steenhoff likes this.