2
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ 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 \$\endgroup\$ – Raxvan Dec 8 '16 at 17:09
10
\$\begingroup\$

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. :)

\$\endgroup\$
1
  • 8
    \$\begingroup\$ For this same reason, you'll run into trouble if you gitignore them. \$\endgroup\$ – tyjkenn Dec 8 '16 at 18:45
-3
\$\begingroup\$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.