[SOLVED] Prefab destroyed or mixes up references of some assets as overrides

It’s been going on for a long time and we don’t know what’s causing it. Sometimes I have no problems for months and sometimes it’s every now and then.
There are two things I want to talk about:

1-Sometimes Unity will do some kind of weird mass reimport that can corrupt some prefabs and we have to get a backup of those or else they’re lost:

9861366--1420710--Unity_y1CvN9lKtV.gif

Here is a before and after of an affected prefab (this one is always targeted):


All that is left is this.

2-Unity will mixes up references between similar instances of prefabs we have inside our Room prefabs and show theses changes as “overrides” even though we didn’t touch them at all:
9861366--1420713--Unity_F63KWSATDs.gif

We can’t afford to manually go into each of our Rooms and check every single reference of every single objects every time this bug happens.

This game project has been worked on for a few years now and went through 2 or 3 unity versions and several Plastic/VCS versions.

I have cleaned A LOT of files over the last few months and changed our folder structure to make it easier in the furture to work on, but also in hope this “magic” problem would go away.
These bugs have been there for a long time and we don’t remmember since when, but I do remmember at first I was the only one impacted on my team and eventually my coworker got it too.

After cleaning the project I made a clean reinstall of everything and settup a new clean repo in Unity VCS.

Last Summer I even built a brand new computer so even with everything fresh, this bug eventually re appeared.

I don’t really know what to do about it, I wouldn’t mind manually fixing things once and for all if I could have the guarantee of it not happening again.

We are using Unity version 2022.3.0f1 and VCS 2.0.7.

Edit:
After fixing by script all the problems I pointed out at number 2 of my post, I saved, pushed to my branch and then wanted to make a build.
After the build was done I saved again and closed unity, but first, the problem happened again and then Unity closed.
After launching Unity again I could see the unwanted changes in a lot of room prefabs:

Room prefabs are rooms that contain a lot of instances of other prefabs.
When looking in one of those room I could see random references here in there swapped between instances of similar prefabs. So this bug does in fact scramble things around.
If I try to look at the difference between before and after in Plastic, there are a VERY LARGE amount of fileID that change. Since there a lot of objects inside these prefab it makes sense.(I reached image limit so I can’t show you but for a single room there is 3284 pages to look at).

Edit2:
I made another build and then when I tried to quit it happened again. Building seems to put unity in a state that requires it to re import and in this case break my room prefabs. I know it can happen in other ways but it’s hard to find.

Update: Affected prefabs are the ones that are included in the scenes I am building.
Building an empty scene does not trigger a reimport of any prefabs.

Can you please report this bug using the steps from Unity QA: Building quality with passion

Thank you for your answer.
I just sent a report. (CASE IN-77491)
I gave some extra information and linked this thread.
I received the confirmation mail but to check the report statut I had to create an Atlassian account, but I already had one? I guess it is what it means in the QA “this is different from your Unity ID”?
Then it told me “You don’t have permission to view this portal.”
Hopefully it’s fine.

Any update of this subject? I still don’t have access to the report status:
9874176--1423653--firefox_SF4djt77B2.png

1 Like

Hi, there,

I’m working with Dimlos on the same project.
Any update on this problem?

For the moment, on my side, the bug only shows up at the same time as Dimlos, when we do a build and quit Unity.
This obliges us to be careful not to make any new changes after a build, to quit Unity, let it re-import all the assets in question, then reopen the project, and Undo the last changes made by the bug before we can continue working on the project.

It’s exhausting because it can really break our entire project.

Here’s a screenshot of all the changes (which we never made).

As of a few days ago, I realised that even tho I still didn’t have access to the report status, I received e-mails that were updating me on the issue and somehow ended up in the spam folder.

I was told that this issue was already fixed in Unity 2022.3.3f1 and above.
It was later found that there was an “Unexpected Asset Pipeline refresh triggered by StopAssetImportingV2 when closing Editor after Build”
It was then fixed and resolved: “All fixes for this bug report have been resolved and closed. Summary: Branch:2022.3.X Resolution: Fixed Fix Versions: 2022.3.3f1”

We then updated our version from Unity 2022.3.0f1 to 2022.3.58f1.

After testing by building AssetBundles or the game itself, the problem wasn’t there anymore.

I really hope it won’t come back, but I’m very gratefull that for now, it’s finally gone after so long.
I would like to thank the Unity dev team for the support.

1 Like