Search Unity

Flaw in new nested Frefab workflow??

Discussion in 'General Discussion' started by nsmith1024, Sep 24, 2019.

  1. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello,

    Im just starting to use the new Unity nested prefab workflow (or what ever you call it) in Unity 2018.3

    So how it works is when you want to edit a prefab, you select it then click on the arrow. When you do this it erases everything from the hierarchy window and then you only have that prefab visible until your done editing it, you click save and then its back to the original hierarchy was there before you started editing.

    This is all fine, but the problem is what if i want to drag a game object from my scene into the prefab im editing is now impossible because as soon as you start editing the prefab, it removes your scene and only shows the contents of the prefab. So you cant drag anything into the prefab any more because its gone for the duration of the editing.

    I dont know if im making myself clear or not. But basically im saying while editing the prefab, only the contents of the prefab is visible, your scene is not visible, so you cant drag stuff from your scene into the prefab anymore.

    Anybody knows how to get around this? Right now i want to drag a a gameObject from my scene into a prefab im editing, but while editing the prefab my scene is not visible, so i cant do it.

    Thanks
     
  2. Janusk

    Janusk

    Unity Technologies

    Joined:
    Jan 2, 2017
    Posts:
    3
    You can drag the gameobject you want to add onto the prefab in your scene. When doing so the icon of the newly added gameobject will get a little plus sign. This means it is added as an override. Overrides can be applied by selecting the prefab the gameobject was added to, click the Overrides dropdown and either one by one apply the overrides or simply hit apply all. The gameobject should now be nested properly within your prefab. Hope this helps :)
     
    angrypenguin likes this.
  3. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Ok thanks for the help!

    Also what i notice is that when i create a brand new prefab (drag existing gameobject from hierarchy into the project window), it immediately has a long list of overrides on it (clicking on the override button in inspector). How can it already have overrides when i just created it?
     
  4. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,980
    Have you read through all the sections about prefabs in the manual? https://docs.unity3d.com/Manual/Prefabs.html

    https://docs.unity3d.com/Manual/PrefabInstanceOverrides.html

    https://docs.unity3d.com/Manual/PrefabOverridesMultiLevel.html

    All of this is dealt with in the manual :)
     
  5. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    In the versions I've used, you can also right-click the added GameObject in the Hierarchy window and "Apply" it to the prefab, which is useful if you've got lots of them.