Search Unity

Change default folder for Unity Project

Discussion in 'Editor & General Support' started by ConkerJak, Jan 9, 2013.

  1. ConkerJak

    ConkerJak

    Joined:
    Jan 9, 2013
    Posts:
    4
    I have 2 hard drives on my computer, the first is an SSD and is almost empty and the second is a classic with more than 1 To free.

    So, I have installed Unity on the second one. But here is my problem : the Unity projects folders are the first one and I can't find any options to change the location of these folders ...

    If anyone knows how to handle it please reply and thank you by advance.
     
  2. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    457
    Hi,

    Currently we have not implemented an option to set the default location of New Unity Projects, yes, it's a frustrating workflow, we are aware of it internally, it's just a lot of other higher priority stuff going on at the moment. :)

    Thanks,
    Chris
     
  3. ConkerJak

    ConkerJak

    Joined:
    Jan 9, 2013
    Posts:
    4
    Ok thank you for the answer.
     
  4. Simon-O

    Simon-O

    Joined:
    Jan 22, 2014
    Posts:
    51
    Hi,

    I know this isn't a high priority in terms of cool new features - but it's such an annoyance and seems like a simple thing to fix.

    I don't mean a GUI option but make it a registry key that power users can edit. Add the UI later. The 2-phase approach should give anyone who cares enough to Google it a solution with minimal effort on your part.

    In any case, can I register this polite request that a dev with some time at the end of a sprint picks this up?

    Thanks
     
  5. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    457
    There has been some work and improvement in this area, unfortunately I can't disclose that info or share a release date, but it's great that we will finally see an improvement here :).

    Looking forward to it.

    Thanks,
    Chris
     
  6. SSix

    SSix

    Joined:
    Mar 5, 2014
    Posts:
    1
    Hello,

    I have been struggling with the same issue, its not much, but a tiny annoyance. After searching, and reading This:

    I decided to experiment, and came up with this solution that WORKS FOR ME - To create symbolic Junction link in windows.

    This is how its done:
    1. I moved all the files out of Documents folder. (Which also saved space on SSD)
    2. run CMD as Administrator.
    3. mklink /j C:\Users\UserName\Documents d:\Documents.
    4. Moved all the files to d:\Documents

    What it does is create a link between 2 folder, but actual files are stored on D:\ drive. (You have a "Shortcute" to the Folder)

    Read more about mklink.
    http://en.wikipedia.org/wiki/NTFS_symbolic_link

    Good Luck
     
    Last edited: Mar 5, 2014
  7. flatplant

    flatplant

    Joined:
    Mar 9, 2015
    Posts:
    18
    I've managed to sort this out, at least in Unity 4.x in Windows, with the help of AutoHotkey. This little script will do the trick for you. Note that it only works if you use ALT-F first to open the File menu, then select "New Project" (with with keyboard or mouse) within 5 seconds of hitting ALT-F. (Had to do it this way because unfortunately AHK can't trigger on menu selections specifically, just keypresses).

    Go here for the wonderful AutoHotkey: http://www.autohotkey.com/

    Just replace the string "E:\Unity\Projects\" with whatever path you want to default to (without the quotes).
    Code (csharp):
    1. #IfWinActive ahk_class UnityContainerWndClass
    2. {
    3.   ~!f::
    4.     WinWaitActive Unity - Project Wizard,, 5
    5.     If (ErrorLevel = 0) {
    6.       ControlSetText Edit1, E:\Unity\Projects\, A
    7.       ControlSend Edit1, {end}, A
    8.     }
    9.     Return
    10. }
    Bit of a hack, but does the trick!

    Update: And/or another way, which changes the default path to the new project when you simply click on the input box:
    Code (csharp):
    1. #IfWinActive Unity - Project Wizard ahk_class #32770
    2. {
    3.   ~LButton::
    4.     ControlGetFocus ctrl, A
    5.     If (ctrl = "Edit1") {
    6.       ControlSetText Edit1, E:\Unity\Projects\, A
    7.       ControlSend Edit1, {end}, A
    8.     }
    9.     Return
    10. }
    The above script will change the default path (as above, replace "E:\Unity\Projects\" with whatever you want) as soon as you click in the "Project Location" input box. Unlike the first script, with this one it doesn't matter how you open the new project dialog. The only thing it looks for is a click in the input box.

    These AutoHotkey scripts work for Unity 4.x on Windows.
     
    Last edited: Mar 17, 2015
  8. Shutter

    Shutter

    Joined:
    Feb 6, 2016
    Posts:
    22
    Today, 3.5 years later, is there an official builtin way of changing the default location of Unity projects?
     
    mooninen likes this.
  9. mooninen

    mooninen

    Joined:
    Apr 14, 2017
    Posts:
    2
    This is amazing... :cool::cool::cool:
     
  10. ZeRuc

    ZeRuc

    Joined:
    Mar 3, 2017
    Posts:
    25
    I am looking to the solution to this problem since I am running out of space on C: drive where my Unity projects are located while my D: drive has over 100 GB of free space. Guess that a symbolic link will have to do :(
     
  11. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,982
    symlink worked
     
  12. MurrayBridgeHS

    MurrayBridgeHS

    Joined:
    Jul 19, 2018
    Posts:
    1
    As we are running Unity in a school lab where the computers are heavily restricted, we needed a way that wasnt involved in the home folder as this is redirected to a network share for students, and the speed in reading/writing the Unity data to the share was very slow
    Also we have the run command disabled so browsing UNC paths doesnt work so we were getting errors here as well.

    The following registry keys are what control the path for the project and workspace path
    Computer\HKEY_USERS\**User**\SOFTWARE\Unity Technologies\Unity Editor 5.x
    kProjectBasePath_h4113231939
    kWorkspacePath_h3086459462

    The data is stored in hexadecimal values in the above locations as a REG_BINARY string

    Convert your desired path from a text string to hex
    https://codebeautify.org/string-hex-converter

    The binary values set in the registry are represented as hexadecimal values but the method used here requires to pass regular decimal vales so we need to convert that as well
    We can use the scientific mode on calc.exe to convert the hex into seperate decimal values
    I got most of the info from this page https://devblogs.microsoft.com/scripting/how-can-i-write-binary-data-to-the-registry/

    We used ActiveSetup to push the setting into the default user hive, so any new users logging in will have this set on first login
    Here is my code to set the paths to the local D Drive. It works for what we want.

    'Setup Unity3D Default Project Path to D: Drive'
    Dim uBinary
    uBinary = Array(68,58,00)
    WriteToRegistry HKEY_USERS, sTempHiveRef & "Software\Unity Technologies\Unity Editor 5.x", "kProjectBasePath_h4113231939", uBinary, "REG_BINARY"
    WriteToRegistry HKEY_USERS, sTempHiveRef & "Software\Unity Technologies\Unity Editor 5.x", "kWorkspacePath_h3086459462", uBinary, "REG_BINARY"

    Apologies if my wording is not correct or if the code could be tidied up, but I havnt seen anywhere that has been able to achive this so am happy to share if it helps
     
  13. Loli_Alois

    Loli_Alois

    Joined:
    Apr 25, 2021
    Posts:
    1
    I've had this issue for months since I can't put anything else in my c drive anymore due to storage limitations and other things on my device so I wanted to move it all to my d drive where i have 800+ gb of space and dedicate it to unity. But even now here in 2022 there still isn't a fix except for codes and set paths?