- Home /
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."
it is a really good question. hope someone finds a work around
Answer by andresp · Nov 19, 2012 at 02:15 PM
Start the folder name with a dot ".".
Unity ignores folders (and files) starting with "." (e.g. .svn, .git...).
Interestingly it seems that while this is true for the editor, any files or folders with a "." are still included in builds that are made. At least if they're within the Resources or Strea$$anonymous$$gAssets folders.
But thats whats Resources folder is for, include at all times.
AWESO$$anonymous$$E! Thanks for this info. I would've never thought of this.
FYI - the "." solution doesn't seem to work for me - I get the below message: "Invalid file name: '.Scripts' UnityEditor.DockArea:OnGUI()" maybe linked to latest unity version. The "WebPlayerTemplates" mentioned below solution worked for me. thanks,
Answer by Bunny83 · Jul 23, 2012 at 10:43 AM
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.
tragically -- this does not work for me!
interestingly it will seem to ignore deliberate syntax errors but it seems to still scan the files to check for the existence of classes, so, it throws errors on 'em all. Suck ! nevertheless thanks!
Well, that's strange. According to the script compilation order page files in this folder will not be compiled at all.
I never used it myself, but maybe the folder behaves like the plugins folder, so it only works when it's directly in the assets folder.
right, I did have it directly in the assets folder.
this is U/S. (did not try c#) as I say oddly it seems to check that any classes mentioned exist, but it does not seem to actually check the syntax of code. (so in some circumstances it would appear to "work")
Confir$$anonymous$$g the same happens with c#. Build errors are thrown ignoring the WebPlayerTemplates trick.
Answer by lrb · May 06, 2020 at 04:00 PM
For me better solution was to add a "~" to the end of the folder name like on the docs: https://docs.unity3d.com/Manual/SpecialFolders.html
So it'll:
not compiling on Editor
not included on Builds
not be visible inside Unity Editor project tab
not be hidden on Windows or Linux
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
Answer by Gru · Aug 28, 2016 at 04:27 PM
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.
Whenever you edit the js in Strea$$anonymous$$gAssets, the Unity compiler notices that and tries to compile modified files. So you need to shutdown editor if you want to edit those javascripts :)
Your answer
Follow this Question
Related Questions
Measuring script recompilation times 1 Answer
Check if public field set in editor at compilation 2 Answers
Assigning class instance to a Gameobject 0 Answers
Compiling Scripts Popup Appears Every Time You Switch to Unity 0 Answers
How can I get more information about this error: "The classes in the module cannot be loaded"? 1 Answer