Why unity need to create meta file for folder?

I understood that unity need to create .meta file pair with asset. But why we need it for folder? Which is not really and asset and so should not require meta file isn’t it?

It not even commit empty folder in version control so meta file is really annoyance in this case. And it just increase the number of unnecessary file in the project

Should the next version of unity remove meta file of folder, or at least could you just skip meta file generating for empty folder?

If you buy a Flowers asset with a folder of flowers, then you move it to Purchased/Environmental/Landscaping/Flowers, then you later see that the artist added 15 more flowers, the installer will instantly be able to add the new content in the correct place.

1 Like

Additionally, thanks to the meta file (and guid) for the folder, it is possible to reference a folder as a UnityEngine.Object in a serialized context. This means, with some editor scripting we can draw a custom inspector field which lets users drag a folder asset into. This makes it possible for custom tools to load files from a special folder, which can then be moved by the user.

So I strongly believe meta files are a good idea for folders. (At least within the current Unity guid-based serialization world)

1 Like

Even if the meta files weren’t necessary, I think it is a bad idea to change things like this unless there was a very important reason to do so. A few extra meta files, I don’t see how they could be causing you headaches.

I don’t understand why you would have created empty folders, but aren’t committing them to your version control. Maybe there is a use case for this that I’m not aware of.

By the way, empty folders causing trouble with Unity may not be Unity’s fault, but a lack in features of the version control system. Git and Mercurial both don’t handle empty folders, but PlasticSCM, for example, does. Sure, there will be pros and cons for both approaches, but at least we can say that Unity’s implementation for folder guids is a valid approach.

1 Like

It’s not like I was created myself. But it was part of many things. Such as when we remove or moving asset around. Upgrade plugins. Delete folder and commit to git then another machine pull it. Or any other reason that cause old folder to become empty