Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question prefab issue

Discussion in 'Prefabs' started by Helladah, Mar 21, 2023.

  1. Helladah

    Helladah

    Joined:
    May 5, 2018
    Posts:
    254
    Hi, i have "modules" for my procedural game, where there are isnide other prefabs, the thing its that i got a new idea for it and i was changing one of those prefabs outside of these so called modules, but when i aply the changes, it dosent affect the prefabs inside those modules, someone can help me about what i could do besides modifie all the modules one by one?
     
  2. QuinnWinters

    QuinnWinters

    Joined:
    Dec 31, 2013
    Posts:
    494
    As of Unity v2018.3 there is the nested prefabs feature. If your module is a prefab, and you enter that prefab instance by clicking the > beside it in the hierarchy and put your other prefab in it, it will save it as part of the module prefab. Then any changes you make inside the other prefab will be reflected in every copy of the module prefab. If you don't enter the module prefab and you drop the other prefab into it as a child, it counts as an override to that module prefab instance and won't effect other copies of the module prefab. Same with the other prefab you're using inside it. If you make direct changes to an instance of it, those changes won't be reflected in the versions of it inside the module prefab instances. But if you go into it using the > beside it in the hierarchy and make changes, those changes will be reflected in every instance of it inside every instance of your module prefab.

    https://docs.unity3d.com/Manual/NestedPrefabs.html
    https://learn.unity.com/tutorial/introduction-to-nested-prefabs-1
     
    Helladah likes this.
  3. Helladah

    Helladah

    Joined:
    May 5, 2018
    Posts:
    254
    Yeah, more or less what i feared, thanks pal for the links ;)