5
\$\begingroup\$

I work with a small team of three people, and we use the collaborate service within Unity to share our progress. One of the folders we have inside our Unity project is an "OffGame" folder, which includes a tool I created specifically to help with the creation of certain assets. It's not actually supposed to be part of the game, but since I'm often making changes to it, I figured I'd include it in the Unity project. The Unity project temporarily makes use of certain files inside said OffGame folder, however, once the game is done, those files will be moved outside of that folder and integrated into the game proper.

Since that OffGame folder is not supposed to be part of the game and I only included it there to share it to my teammates over the collaborate service, I don't want it to be treated like a normal folder for the game. Specifically, I don't want Unity to create a bunch of useless meta files for each file in that folder, or to act like a stray .js file in there is part of the project. I actually got compile errors because Unity kept thinking it had to include all the .js files in that folder.

How can I make Unity ignore that folder?

\$\endgroup\$
2
  • \$\begingroup\$ There's a great tool on the asset store that handles this issue. assetstore.unity.com/packages/tools/utilities/… \$\endgroup\$
    – Randy C
    Commented Oct 17, 2022 at 19:10
  • \$\begingroup\$ Presumably you considered just keeping the folder / the files you want ignored outside your Assets directory entirely? \$\endgroup\$
    – DMGregory
    Commented Oct 18, 2022 at 13:44

1 Answer 1

8
\$\begingroup\$

During the import process, Unity completely ignores the following files and folders in the Assets folder (or a sub-folder within it):

  • Hidden folders.
  • Files and folder which start with ..
  • Files and folder which end with ~.
  • Files and folders named cvs.
  • Files with the extension .tmp.

Source

\$\endgroup\$
4
  • \$\begingroup\$ So what does "import process" mean in this context? When stuff gets added to the project folder or when it's uploaded to the collaborate tool? If I add a "." at the start of my OffGame folder, will it still be uploaded? \$\endgroup\$
    – user97936
    Commented Feb 10, 2019 at 21:42
  • 1
    \$\begingroup\$ @noClue The import process refers to Unity's asset importer that runs when you introduce a file to the project. The file will still be uploaded if it doesn't match your .collabignore file. I looked at the default and .* is not excluded (._* is!). \$\endgroup\$
    – Landon
    Commented Feb 11, 2019 at 0:52
  • \$\begingroup\$ I tried it with an ~ at the end of my folder name (OffGame~), but the files weren't uploaded. I'll try to prepend the folder name with a "." when I get home. I thought they would all behave the same. For those who don't know how to put a dot at the start of the folder name, you need to add one at the end as well, so in my case ".OffGame.". The last dot will be removed automatically. \$\endgroup\$
    – user97936
    Commented Feb 11, 2019 at 8:33
  • \$\begingroup\$ Nope, didn't work... it just gets completely ignored by Unity. \$\endgroup\$
    – user97936
    Commented Feb 11, 2019 at 22:06

You must log in to answer this question.