Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?

Post by AoF »

Easiest to show this with a gif:

Why does this never save?

No change there that I can see anyway: Image

I asked on the Unity forum and I was told:
Whatever made the changes to a Prefab needs to call various SetDirty methods but also

UnityEditor.PrefabUtility.RecordPrefabInstancePropertyModifications(eachComponentYouTouch)
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?

Post by Tony Li »

halley is correct that when you inspect a prefab instance in a scene, a blue line on the left side of a property means it has a custom value that overrides the prefab's value. When you select Overrides > Apply All, the blue lines should disappear because it will apply those overrides to the prefab itself.

However, what she doesn't mention is that when you apply a prefab instance's overrides to a prefab, it always sets the scene dirty. If you save the scene, the '*' should disappear. (File > Save Scenes) Nothing needs to be done in a script.
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?

Post by AoF »

It's hard to see, but I actually am saving multiple times in the gif near the end. You'll notice that * on the scene name disappears and reappears. Though, I couldn't find a Save Scenes. I see a Save and a Save Project. I've tried both and after overriding and trying both, I'm still asked to override the same changes again and that feels wrong. It still says there's something to override.

I'm wondering if you can reproduce this in the project I sent you yesterday?

PS: I didn't get an email for your reply to this even though I usually do. Just thought you should know.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?

Post by Tony Li »

AoF wrote: Wed May 29, 2019 3:00 pmIt's hard to see, but I actually am saving multiple times in the gif near the end. You'll notice that * on the scene name disappears and reappears. Though, I couldn't find a Save Scenes. I see a Save and a Save Project. I've tried both and after overriding and trying both, I'm still asked to override the same changes again and that feels wrong. It still says there's something to override.

I'm wondering if you can reproduce this in the project I sent you yesterday?
Not currently, but it's a known issue in Unity that still isn't fixed in Unity 2019. If a UI element has an auto layout component of some type, such as Horizontal Layout Group or Content Size Fitter, the Rect Transform values in the scene may be slightly different from the prefab due to floating point precision.

If you're not planning to use any TextInput() sequencer commands, you can delete the Text Field UI GameObject. This will eliminate one of the possible sources of this issue, since Text Field UI has a an auto layout component.
AoF wrote: Wed May 29, 2019 3:00 pmPS: I didn't get an email for your reply to this even though I usually do. Just thought you should know.
Is your spam folder trapping them now perhaps?
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: Why won't this prefab override stay overriden?Can anyone recommend cool assets to make my 2D game look polished?

Post by AoF »

Tony Li wrote: Wed May 29, 2019 3:28 pm Is your spam folder trapping them now perhaps?
Nope, but it turned out that I was wrong and I did receive the original email. Sorry for wasting your time on that.
Post Reply