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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question delete the cache in \USER\AppData\Local\Unity\cache

Discussion in 'General Discussion' started by xmission, Mar 3, 2023.

  1. xmission

    xmission

    Joined:
    Jan 11, 2023
    Posts:
    3
    I really need to temporarily free up space on my system drive.
    Would it be safe to delete the cache in this folder? C:\Users\USER\AppData\Local\Unity\cache
    There is 2 fodlers
    npm
    packages

    Thank you!
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,184
    You should be able to safely delete the folders but if any of the packages in there are necessary they will just be cached once again. Instead if you've used the asset store I recommend copying the packages from the location below to a different drive and when you need them you can manually drag and drop them into Unity:

    C:\Users\USER\AppData\Roaming\Unity\Asset Store-5.x
    .
     
    Last edited: Mar 3, 2023
    xmission likes this.
  3. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,005
    Indeed, though I regularly delete some of the larger packages from at least the ‘packages’ folder, as Unity will simply unpack them again from the ‘npm’ folder if they are needed again. Though sometimes I just delete both folders, especially as with working with Unity for so many years and across so many editor versions you can easily build up a large amount of packages that are never used as they get superseded.

    Alternatively you could try my AssetStoreOrganizer editor script (GitHub) that provides an interface that allows you to back up and restore asset store packages to a different folder (on a different drive ). I use it to move packages in and out of the Unity folder as needed so I only store about 1Gb on my main drive and the 20Gb plus of other assets elsewhere.

    In more modern versions of the editor you can set a custom path for where packages and asset store packages are saved, though it’s unclear if that works for previous editor versions.
     
    xmission and Ryiah like this.
  4. xmission

    xmission

    Joined:
    Jan 11, 2023
    Posts:
    3
    Thanks for nice idea!
     
  5. xmission

    xmission

    Joined:
    Jan 11, 2023
    Posts:
    3
     
  6. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,497
    Alternatively, if you have another drive, you can simply create a SymLink so that the cache folder is actually on a different drive.

    You can either use command line or a tool such as https://github.com/amd989/Symlinker

    Newer versions of Unity let you define your cache folder locations in your Edit>Preferences
     
    Last edited: Mar 11, 2023
    breylinlee and angrypenguin like this.