
Two, it incorrectly ignores valid files if they lack an extension. One, it fails to ignore folders with a dot in their name. There are some caveats with this approach. We use Perforce and achieve this through the. Our solution is to never submit them to source control. Managing Folder Meta Filesįolder meta files are worthless. The good news is that knowing is half the battle! The other half is writing tools to detect errors before they are submitted to source control. We’ve established that there are certain catastrophic failures and they can happen in a variety of ways. I run this tool periodically after syncing latest. I use a tool to remove empty directories. If there is cruft then you’re more likely to submit an error that does matter. However if you reconcile with Perforce it’s super important to have a “clean” reconcile. If the folder meta file was deleted then Unity will see the empty folder and generate a new meta file. If all the files are deleted in a folder and you sync Perforce it will delete the files but leave the empty folder. When I sync my machine I will have both the old files and the new files which means a duplicate guid. If you submit only the add operation but not the delete operation then your machine will be fine. You are deleting old files and adding new files. When you move an asset through the editor there are two source control operations. Moved asset but left old file in source control Unity correctly handles moving assets and their meta files. When moving assets always do it through the Unity editor. If you copy an asset and it’s meta file in Windows Explorer/OS X Finder then you have a duplicated guid. Manually copied asset + meta file to new location They are more disruptive and confusing than catastrophic. These are all straight forward and easy to fix.


Deleted meta file without deleting asset.Deleted asset without deleting meta file.Submitted meta file without submitting asset.These mistakes are uncommon so I’m lumping them together. Here are three different mistakes which can be made. When using source control you also need to submit add operations or delete operations as a pair. Unpaired asset/meta fileĪssets and meta files should always be created and deleted as a pair. If I submit my meta file then when you sync you’ll get a new meta file with a new guid which is changing a guid which is catastrophic.

When this case happens the person who originally created the file must submit their meta file.

If you also checked in objects with references to your guid then on my machine those references will become missing behavior errors. However my file will have a different guid than your file. If you forget to submit a meta file and I sync then I will generate a new meta file. You created a script or texture but forgot to the submit the matching meta file. Submitting new asset without meta fileĮasily the most common mistake. Given that changing a guid is catastrophic and by extension duplicating guids is catastrophic there are a handful of user operations which can cause either catastrophe to happen. Most pain and suffering related to meta files has to do with this guid. The guid is randomly generated when the meta file is created. Every asset has a meta file and every meta file has a unique guid. Here’s an example:įor this post there’s only one line we care about. Meta files are simple text files that are human readable. Once enabled every asset you create will have a matching meta file generated by Unity. When using source control we want to enable visible meta files. For example texture import settings can’t be stored in a. How to make enemy look at player unity.What is a Unity meta file? Meta files store data about an asset that can’t be stored inside the asset.
