- Home /
Problems with nested prefabs
I have had some issues with accessing and updating nested prefabs in Unity 3, and I was wondering if anyone knew more on the subject.
Hypothetically, say that I have a Tire prefab which is then a child of a Wheel prefab. I then want to make that wheel part of another prefab called Car. I can do this, but when I create the Car prefab in the project view I can only access one level of the nested prefabs. Then, when I start making cars in my scene and I want to change some parameter of the Tire prefab and have it update across all of my cars, it doesn't work. It changes in the project view, but the changes don't affect any of the childed instances in the scene. Are nested prefabs that are more than one level deep not supported right now, or am I doing something wrong?
Answer by skovacs1 · Nov 03, 2010 at 08:06 PM
Nested prefabs don't work like you'd hope. A GameObject can only reference one prefab at a time.
- Prefab a
- Prefab b has an instance of Prefab a called ba
- I change Prefab a and ba will not change because ba is a part of Prefab b and references Prefab b, not Prefab a anymore.
It is annoying that we cannot access more than one level of depth in a prefab in the project view and I wish they would fix that. Changes to the prefab more than one level deep will take effect on all instances of that prefab, but because we cannot access them in the project view, you have to go through hoops like changing them in code or overwrite your prefab >( which is not fun. There is probably an easier way, but I've just taken to the habit of avoiding the problem entirely.
Answer by Bento-Studio · Mar 12, 2012 at 11:13 AM
It is now possible to create nested prefabs via this extension click here