- Home /
Necessary to remove unused scripts from imported packages for deployment?
It looks like Unity compiles all scripts, even ones that are not referenced or used in any of the gameobjects in a scene/proj hierarchy. For example, if in an unused script, you declare a enum GameStates
, and you declare it in a script you are using, an error like: "The namespace '' already contains a definition for 'GameStates'.
In that case, should unused scripts simply be removed from the project pane? Is there a way to put them in a folder (still accessible within the proj pane), so that they won't be compiled?
Answer by Peter G · Dec 24, 2010 at 04:05 AM
You do need to remove them. The only folder that I can think of that is not included in the final build is the editor folder, but it is probably easier just to remove them from the "Assets" folder entirely.
What if you might use some of the currently unused scripts later - what would be a better "temp storage" place?
I would place them in a folder next to your assets. Then go through finder or explorer and add the folder when you need it. And it won't be hard to find either.
Your answer
![](https://koobas.hobune.stream/wayback/20220613092400im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The type or namespace name `Web' does not exist in the namespace `System' 3 Answers
Quickly isolate GameObjects in Hierarchy with scripts in them? 2 Answers
Disabling scripts from compiling, but still shows in project pane? 1 Answer
Cannot assign script to objects when class is within a Namespace 1 Answer