What happens if I delete .meta files?

In Unity, what happens if I delete the meta files? Or if I import files, but not their respective .meta files?

What are some issues I could come across? Is there ever a reason I would want to delete meta files?

I was asked this question recently, and I do not know the answer.

• short answer: bad things. .meta files store information about the file with the same name, information that is used by unity and that can be indirectly changed by content creators. if you delete them you loose that information and, depending on what you removed, references can be lost, things have to be reconfigured, etc – Raxvan Dec 8 '16 at 17:09

2 Answers

Some .meta files contain important information.

For example, this is part of a .meta file for a .png file in our project:

fileFormatVersion: 2
guid: a652b1795b650454a8270045af8e2a71
timeCreated: 1459880238
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0


You can see there are a lot of settings that tell Unity how to use the associated .png file.

If you delete this .meta file, it will regenerate it, but you'll lose any import settings you had set. It can cause other issues, but just this example should be enough to convince you to leave them alone. :)

• For this same reason, you'll run into trouble if you gitignore them. – tyjkenn Dec 8 '16 at 18:45

Yes - Unity will reimport all of the assets and the project will rebuild the next time it is launched, if the 'metadata' folder is deleted.

It won't help cut down the file size, because the folder will re-create and grow to about the same size.

• This seems to ignore the obvious fact that you will still lose "progress" if you delete a meta file. Not everything will be rebuilt. – Gnemlock Dec 8 '16 at 21:01