Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug almost in 2022 and Unity still force assets install on the C drive?

Discussion in 'Unity Hub' started by rapidrunner, Nov 1, 2021.

  1. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    I have seen this issue since version 2.0 of Unity; and every time someone say "we will change that at one point". Well; not sure when "Soon" is but so far we are still bound to download everything on the C drive.

    I downloaded again the latest unity hub; installed a new build of Unity and the editor is installed correctly on my secondary drive, not on C.

    Although when I download packages from the asset store; they are still saved in
    appdata\Roaming\Unity\Asset Store-5/x
    on Windows 10. I assumed that the assets will now be copied in the same location I specified in Unity hub for the editor, but nope.

    And yes; it is a small thing; because you say "just make a symlink". I made a symlink; and when I download packages via Unity; it create again the Asset Store-5.x folder, ignoring the symlink. On top of that there is another folder called "Asset Store" with some other items, which does not seem to work with symlink either.

    I understand that for legacy reasons, the Unity folder must be in the Roaming folder; because this is the main reason why we still can't decide where the packages go, right? Otherwise I am not sure why we are still here talking about something that in principle is really straightforward to implement.

    I don't want to have Gb and GB of assets on my C drive, and yet I am forced to. Not sure what will take for Unity to finally change this, but I hope it will eventually happen.
     
    jmbfire1000 likes this.
  2. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    You're right, this is quite annoying, and not only about the assets but also about the caches.

    Here are the procedures I apply when installing Unity on a new computer, they worked fine 6 months ago (change the destination drive/folders as you see fit):

    Package Cache
    -------------
    1. Move the complete 'C:\ProgramData\Package Cache\' directory to another place (the source directory 'Package Cache\' must be deleted)
    2. Create the junction: mklink /J "C:\ProgramData\Package Cache" "D:\ProgramData\Package Cache"

    Unity GI cache
    --------------
    1. Open Unity preferences
    2. Open the 'GI cache tab'
    3. Clean the GI cache
    4. Set a new place for the GI cache

    Unity AssetStore download
    -------------------------
    1. Move the 'C:\users\username\appdata\roaming\unity\asset store-5.x\' directory to the destination (the source directory 'asset store-5.x\' must be deleted)
    2. Create the junction: mklink /J "C:\users\username\appdata\roaming\unity\asset store-5.x" "E:\users\username\appdata\roaming\unity\asset store-5.x"

    Move other caches away
    -------------------------
    Step 1: Open the System properties (right-click on the 'Computer' icon, select 'Properties', then click on on 'Advanced system properties'
    Step 2: Add the 'UPM_NPM_CACHE_PATH' variable with the destination directory (do not create the destination directory)
    Step 3: Add the 'UPM_CACHE_PATH' variable with the destination directory (do not create the destination directory)
    Step 4: Delete the 'npm' and 'packages' directories from 'C:\Users\<USER_NAME>\AppData\Local\Unity\cache\'
    Step 5: Restart the computer
     
  3. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Nice reply; I didn't realize that there were more cache folders in Local folder... I hope Unity eventually decide to add those in the settings
     
  4. Jvoxel

    Jvoxel

    Joined:
    Apr 29, 2022
    Posts:
    3
    thanks for the explanation but I am not clear on this.
    Which are the destination directories for UPM_NPM_CACHE_PATH and UPM_CACHE_PATH is it D:\ProgramData\Package Cache?
     
  5. Jvoxel

    Jvoxel

    Joined:
    Apr 29, 2022
    Posts:
    3
    Also should they be System or User enviroment variables?
     
  6. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    I've put them in System.

    I don't remember the original paths, but what I can tell is that both UPM_NPM_CACHE_PATH and UPM_CACHE_PATH contains a 'packages.unity.com\' directory.
    UPM_CACHE_PATH does contain the packages uncompressed, while UPM_NPM_CACHE_PATH contains the compressed version of the packages.
     
    Jvoxel likes this.
  7. Jvoxel

    Jvoxel

    Joined:
    Apr 29, 2022
    Posts:
    3
    Thank you for your help, I moved unity to am M2 drive and this helps keep my OS disk free of big files. thanks