Lack of support for nested prefabs is known problem in Unity. When you drag nested Game Object from the Hierarchy to the Project explorer prefab gets created as usual, along with its children. However if the Game Object has grandchildren - they won't be visible in the Project explorer even though they exists in the prefab. In order to edit grandchildren usually you have to drag the prefab onto the scene, edit, and then sync prefab instance with the prefab. Furthermore edits in one prefab's children won't be reflected in another prefab's children (assuming that you edit the same child object).

I've ran into simple workaround for implementing nested prefabs using a script: Poor Man's Nested Prefabs

Nesting prefabs with this script is more like a linking - prefabs are stored in "flat" structure and you link them by adding script component referencing a child.

I had few problems with that script which probably isn't so surprising since it's from 2013. First of all - linked child prefabs are instantiated on Run/Build, which doesn't allow to customize children of individual instances. Secondly you can see all the chidren in the scene (because the script draws all meshes and gizmos) however you can't hide or select the linked prefabs.

I've modified the "Poor Man's Script" a bit and simplified it to supply my needs. My version (I called it "Very Poor Man's Script"...) is just instantiating linked prefabs as soon as you drag the parent object onto the scene. You still need to keep all child prefabs separately in "flat" structure, however now you can customize instances of children, hide them or select them in the scene via references etc.


Let me know what do you think about the script, whether it's useful for you in one way or another and how would you like me to possibly improve it (use the Contact Page).

using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Callbacks;
#endif
using System.Collections.Generic;

namespace Assets.Scripts.Helpers
{
    [ExecuteInEditMode]
    public class PrefabInstance : MonoBehaviour
    {
        public GameObject Prefab;

#if UNITY_EDITOR
        void OnEnable()
        {
            if (enabled)
            {
                foreach (var o in FindObjectsOfType(typeof(PrefabInstance)))
                {
                    var pi = (PrefabInstance) o;
                    BakeInstance(pi);
                }
            }
        }

        // Baking stuff: Copy in all the referenced objects into the scene on play or build
        public static void BakeInstance(PrefabInstance pi)
        {
            if (!pi.Prefab || !pi.enabled)
                return;
            pi.enabled = false;
            GameObject go = PrefabUtility.InstantiatePrefab(pi.Prefab) as GameObject;
            Quaternion rot = go.transform.localRotation;
            Vector3 scale = go.transform.localScale;
            go.transform.parent = pi.transform;
//            go.transform.localPosition = Vector3.zero;
            go.transform.localScale = scale;
            go.transform.localRotation = rot;
            pi.Prefab = null;
            DestroyImmediate(pi);
            foreach (PrefabInstance childPi in go.GetComponentsInChildren<PrefabInstance>())
                BakeInstance(childPi);
        }
#endif
    }
}