Issue setting a modified property on a Prefab instance back to the value in the Prefab

Hello,

I have been using Nested Prefabs, and it is great. However, one thing that really bugs me is that, suppose I have a Prefab that has been instanced into a Scene.

In the scene, I change a property of the prefab, for example, maybe the Prefab has a Sprite Renderer and I change the Order in Layer from default 0 to 10.

The Order in Layer becomes bold:
3909640--333145--upload_2018-11-20_19-58-55.png

Then I decide to set it back to 0. The problem is that even though the property is now the same value as in the Prefab, it is still marked as changed.
3909640--333148--upload_2018-11-20_20-0-52.png

So now, it shows up when clicking ā€œOverridesā€. And so to keep everything nice and clean I have to either revert or apply this ā€œno changeā€

3909640--333151--upload_2018-11-20_20-2-8.png
^ Nothing actually changed, but I have to waste time to apply or revert it.

It is also ā€˜visual pollution’ and makes it harder to find the actual changes (or if there are any) that really need attention.

This is something that really bugs me.

Also, since I have some [ExecuteInEditMode] components that automatically set the Order in Layer, then this results in all my Sprite Renderers being marked as changed, even though the value isn’t actually changed.

I think fixing this would greatly improve usability and ability to see what actually has changed.

This is by design. We can’t assume that an override should be removed just because it has the same value as in the Prefab Asset. An overridden value will keep that value, also if the value in the Prefab Asset changes. If you no longer want that behavior you need to explicitly tell Unity this by reverting.

Note that you can revert an overridden property by right-clicking on it and choosing Revert from there. You don’t have to open the Overrides dropdown.

Oh, I kind of see the reason then. Thank you for the explanation!
I guess I’ll just need to adjust my ExecuteInEditMode component.

1 Like