New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NudityStation - Prefab Variants Cause Missing References And Lose Connection To Parent #2551
Comments
I'm adding those lines to the PopulateItemStorage function:
That won't solve the issue but will make finding the missing asset easier and won't cause a bug when starting the round. |
A mystery to be solved : why did we both get the same issue, at the same time, with the same asset? (Breathmask too!) |
possibly relevant discussion here: https://forum.unity.com/threads/missing-prefabs-with-freshly-downloaded-project-windows.411721/ |
also here's the YML for BreathMask.prefab. I'm thinking maybe it's the fileID reference that's wrong? I'm not sure what in here corresponds to fileID, maybe that
|
so I just fixed this by closing unity, git reset --hard, then switching to develop, then reopening unity. The file contents are still the same but it didn't require a reimport. |
And then it broke after I made a standalone build of the game. |
So I closed unity, did a git reset --hard, reopened, then when I open the StandardSmallBoxPopulator asset in editor the reference is no longer shown as missing. I checked and saw that the file contents I pasted above were still all the same. Then I created a standalone build. After the build was done, I got the "importing..." progress bar, all of my prefab assets showed as modified by git, and this issue reappeared. It was only the prefabs that were showing as modified. This particular asset, BreathMask.prefab, only differs by line separators according to git. |
And the key difference I noticed between the assets that this happens to and the ones it doesn't happen to is, the ones it happens to are prefab variants. The ones it doesn't happen to are just normal prefabs. |
Temporary workaround. Building standalone game causes the issue. Git reset hard fixes it. So, after every standalone build you should ensure you've committed your changes and run |
Updated with new findings and temporary workaround. |
created a thread for this: https://forum.unity.com/threads/prefab-variant-missing-references-and-losing-parent-settings.807840/ Working on a reproduction to submit a bug report. |
foma heard from a Unity dev that this is supposedly fixed in 2020, but it's going to be awhile before we actually switch to that |
the project updated its unity version and nuditystation doesnt seem to be happening anymore, or prefab variants losing the values of their parent |
Temporary Workaround
There are 2 ways to workaround this in the meantime. DO NOT DO A REIMPORT ALL, SAVE YOURSELF THE TROUBLE.
git reset --hard
should fix it. This restores the missing asset reference. I don't think you need to close Unity.Both of the situations seem to happen after doing a standalone build. So you might want to check after you do a build to see if clothing items (such as MiningHardsuit.prefab) have correctly filled out ItemAttributes and references aren't broken (such as SmallBoxPopulator's references to breath mask)
Description
This only seems to affect prefab variants and references to prefab variants. It usually shows up in the game where you spawn the player and they are missing several of their starting items.
This usually only happens after merging or switching branches or doing a standalone build.
You can see this in action in 2 ways (sometimes only one of them happens).
The text was updated successfully, but these errors were encountered: