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

How to prevent "Override" to my Prefab

Discussion in 'Prefabs' started by kencoderhk, May 2, 2019.

  1. kencoderhk

    kencoderhk

    Joined:
    Dec 11, 2018
    Posts:
    9
    This is my case, I have an utility component and It work with some child objects, and I don't want those changes become overrides, is there any way to do so?

    The real case is that > (Related UI)
    I have a component called "SafeCanvas" (which help the child objects aligned with the Safe area in a mobile phone)

    So, those containing elements aren't override in theory, they are just user objects for the SafeCanvas;
    And now, those child elements having the "+" symbol

    You guy can see the screenshot for detail. Screenshot 2019-05-02 at 11.48.30 AM.png
     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    The plus indicates it's not part of the Prefab instance even though it's a child of the Prefab instance. If there was no plus, it would indicate that they are part of the Prefab.

    You can't add something as a child of a Prefab instance without it appearing as an override that you have the option to apply. But you can leave them there and just not apply them; that's a completely regular approach.
     
    kencoderhk likes this.
  3. kencoderhk

    kencoderhk

    Joined:
    Dec 11, 2018
    Posts:
    9
    Thanks for the clarification ^_^

    About " But you can leave them there and just not apply them",
    somehow it is not easy manage, if someone forget that prefab cannot be applied new stuff, problem happened ;)
     
  4. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Right. It's best to get into a mindset of not seeing overrides as something to apply. Overrides are for when you want something on a specific instance to be different from the Prefab Asset. Sometimes you might want to apply overrides, but think of it as the exception, not the norm, and inspect all overrides before applying them to make sure applying them is correct. That's why we list them all in the overrides dropdown.

    If you want to make changes to the Prefab Asset, we recommend using Prefab Mode instead of "modify instance and apply".
     
    Roni92pl and kencoderhk like this.