unity3d Prefabs Nested prefabs


Example

Nested prefabs are not avaible in Unity at the moment. You can drag one prefab to another, and apply that, but any changes on the child prefab will not be applied to nested one.

But there is a simple workaround - You have to add to parent prefab a simple script, that will instantiate a child one.

using UnityEngine;

public class ParentPrefab : MonoBehaviour {

    [SerializeField] GameObject childPrefab;
    [SerializeField] Transform childPrefabPositionReference;

    // Use this for initialization
    void Start () {
        print("Hello, I'm a parent prefab!");
        Instantiate(
            childPrefab, 
            childPrefabPositionReference.position, 
            childPrefabPositionReference.rotation, 
            gameObject.transform
        );
    }
}

Parent prefab:

Parent prefab

Child prefab:

Child prefab

Scene before and after start:

Before start enter image description here