Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Feature Request "Default folder path for new scripts" option in settings

Discussion in 'Editor & General Support' started by mfatihbarut, Dec 6, 2022.

  1. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,058
    Hi,
    We definitely need an option for "Default folder path for new scripts"
    Thank you
     
  2. BABIA_GameStudio

    BABIA_GameStudio

    Joined:
    Mar 31, 2020
    Posts:
    488
    Why do we? What if I want to categorise my scripts based on the type or prefab it relates to? This would make a default folder useless as I would have multiple places where I want my scripts to be and if there is a default path I would be having to constantly change it to match where I actually want my script to be.
    It's quicker just to go to the right asset folder and right-thinking create script, surely?
     
  3. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,058
    you don't use this feature then.
     
    ccfoo242 likes this.
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,883
    People use the 'Add Component' new script menu to make scripts? I thought only newbies did that.

    Most users will be making them with the right-click menu in the folder they intend to live in, and have plenty of different script templates set up to speed up the process.

    If you're dumping all your scripts in one folder... that's terrible project management sorry.
     
    Kurt-Dekker and BABIA_GameStudio like this.
  5. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,058
    Branching for scripts is also pain in the as, even though it is my principle as Programmer, I don't use it for my Unity projects.
     
  6. ccfoo242

    ccfoo242

    Joined:
    Oct 9, 2014
    Posts:
    85
    These replies are so disappointing. "only noobs do that", "my process is uber complicated"
    How about when you are just iterating or following a tutorial? Do you make sure all your code uses namespaces and setup asmdef's? It's a simple request and a simple feature to implement. Its fine if you are so AAA that this is not for you. And I'm sure people who land on this page appreciate the help you didn't provide in your responses. :rolleyes:
     
    Marc-Saubion and AldeRoberge like this.
  7. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,883
    Honestly, yes, because sometimes a tutorial or testing becomes a prototype that leads to a proper project. Might as well always practice good project discipline.
     
  8. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    48
    Almost two years later, this is still very much a problem.

    Especially with assembly definition files (.asmdef), the scripts created by default using the Add New Component window are created at the root of the Assets folder.

    This wouldn't be much of a problem, except that we nowadays usually structure our projects this way :

    Assets/Project/Scripts

    Meaning that it's the scripts are included in the Assembly-CSharp.dll by default, meaning the recompilation is very slow. Then moving those scripts requires another recompilation.

    upload_2023-7-27_16-2-31.png

    I wish Unity would also enforce Third Party assets to use the "Plugins" folder, to differentiate from your scripts and the downloaded assets. It's hard to stay organized when the root of the Assets folder contains newly created scripts + third party assets.

    1. Allow users to choose where the scripts are created when using the Add New Component window (right now this is hardcoded in AddComponentWindow's NewScriptElement from UnityEngine.dll.
    2. Enforce or highly suggest third party plugins to use the "Assets/Plugins/" folder
    3. Enforce or highly suggest third party plugins to use .asmdef files

    This would greatly help to stay organized.

    I agree that this is only a problem if you use the New Component window, but it's very convenient for fast prototyping.

    upload_2023-7-27_16-1-35.png

    Other people asking the same thing :
    https://stackoverflow.com/questions...unity-placing-new-scripts-in-the-project-root
    https://discussions.unity.com/t/change-default-script-folder/92375
     
    ccfoo242 likes this.
  9. ZanthousDevelopment

    ZanthousDevelopment

    Joined:
    Jul 12, 2023
    Posts:
    9
    Would really like this added as well
    >just use the right click instead

    I generally found myself avoiding this since it has 10000000 options and you have to click through Create > to get to it, on top of looking for a location to put it. The extra organization is good sometimes, but a lot of the time I just want this to be super frictionless, especially for smaller projects.

    That being said, I just made a shortcut for making a script so maybe I can get used to it.
     
  10. tdlk

    tdlk

    Joined:
    Jul 6, 2017
    Posts:
    2
    Would like to see this as well!