Isn't there a "do not compile" folder?

I’m sure there’s a Special folder name,

that simply tells Unity to ignore it, ie, you can sit scripts in there for convenience that are simply not compiled, ignored by Unity.

Does someone remember the name of this special folder?

thanks!

PS it’s so silly they don’t have a page in the doco: “absolute list of special folder names.”

Start the folder name with a dot “.”.

Unity ignores folders (and files) starting with “.” (e.g. .svn, .git…).

There’s no dedicated folder for this purpose. We wanted such a folder for a long time.

You should be able to use a “WebPlayerTemplates” folder since this is usually ignored by the compiler since the webtemplates could contain .js files (web-javascript files) which shouldn’t be compiled in Unity.

See UsingWebPlayertemplates

WebPlayerTemplates trick does not work any more since web player is discontinued. Instead, scripts placed in StreamingAssets folder are not compiled, but it seems they will be included in the build as text assets if you leave them there.

For me better solution was to add a “~” to the end of the folder name like on the docs:

So it’ll:

  1. not compiling on Editor
  2. not included on Builds
  3. not be visible inside Unity Editor project tab
  4. not be hidden on Windows or Linux
  5. have as many folders as you want, starting with the alphabetical order you want

But if I need that folder to be under Unity’s built-in version control, I need to put inside:

WebPlayerTemplates

It’ll continue to work with the 5 points mentioned before, except that will be visible on editor project tab, at least on Unity 2019.3.x

There is another way.

After 9 years, we can now use Assembly Deffinition files.

In the folder that you do not want to compile, right-click to create an Assembly Definition file, open the Inspector, check the “AnyPlatform” checkbox, and turn on all the “ExcludePlatform” checkboxes.

This will prevent all the .cs files in the folder/sub folders from being compiled recursively on all platforms. (including Editor).

Yes, Editor