We have a pretty massive codebase with a handful of developers all committing to it. One of the things that keeps coming up in our regression tests is a broken prefab link in one of our main game objects. We’ve fixed it many times and committed the change, validated it being fixed on the build computer, but we keep discovering that link broken again a few days later.
Unfortunately that broken link causes our session saving class to fail, so it’s somewhat critical. Seems lame to have to resort to Resources.Load because the same link keeps getting broken over and over!
We have a similar issue where one of our characters keeps reverting to the default layer, which breaks his functionality.
Any ideas what might be causing these kind of reversions?
There really isn’t any fix because git works perfectly with Unity when configured properly.
Best practices involve saving your work and closing Unity before using git.
But if you understand how Unity does and does not flush changes to disk (or at least ALWAYS do a save-project), you can get away with leaving Unity open.
The only thing linking EVERYTHING together in Unity is the GUID assigned to a script or asset. Name is irrelevant. Only the GUID connects it. This GUID is in the meta file.
If you fail to commit metafiles to git, you will never be able to work in Unity. 100% of all meta files and all changes to all meta files must be committed along with the work that triggered it, no exceptions.
In your ProjectSettings, these two things MUST be correct for git: