Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question on reducing Unity size by removing unwanted components

Discussion in 'Getting Started' started by Unity-Student0, Jan 23, 2022.

  1. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    Hello to anyone,

    As Unity LTS improves with more features, the size is getting bigger and archiving them takes more space. I just tried to delete the TextMeshPro because my past tutorials show that Text is more frequently used with Canvas. I got an error saying that the package is read-only.

    So I'm now wondering whether there are such plans from the Unity development team in the future, together with a website of best-practices or guidelines that might be appearing to say what can / should be retained. Has anyone thought of this? See my screenshot.
     

    Attached Files:

  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,954
    If you want to remove a package from a project you need to use the package manager. Nearly all other methods won't be permanent (eg if you delete the folder through a file manager and re-open the project Unity will re-add the package folder).

    https://docs.unity3d.com/Manual/upm-ui.html

    That said I wouldn't stress out over a few megabytes. It's only large when you're just getting started. My current work project is sitting at 400 GB (three separate copies thanks to different platforms requiring different releases of Unity) and it's still a good ways from being complete. Actual builds are way smaller at around 4 GB.
     
    Last edited: Jan 23, 2022
  3. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    That's why I'm hoping the Unity team will make it so that I can manually remove what I don't want. Unity team, I hope you are reading this. More flexibility please.
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,754
    As Ryiah said, uninstall unneeded packages. If you do 2D don't start 3d or HDRP sample scend for example.
    Load packages only as required. Purge libraries from time to time.

    This are some of ways, to keep project size small.

    But if you struggle wit a space, move away unused projects, remove libraries of unused projects. Pack unused projects. Also use VC.

    Get additional drive space.
     
  5. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    Did you not read what @Ryiah said? You can manually remove stuff, and you access that for packages via the package manager.

    This isnt an issue with flexibility, as evidenced by many of your past posts this is an issue with you asking questions but then not reading / trying out the answers and basically ignoring all advice given to you by more experienced members. Actually try what Ryiah said, its basically a 2 click operation... if that is not easy enough for you then nothing unity adds is going to help you.

    Secondly, as has been said before, asking for stuff like this on the general forums is not the place as unity staff will more than likely not read this and its not a support forum. Its literally just for general discussion, so of all the places on the forum its about the worst place to post anything like this.

    Good luck! :)
     
    Antypodish likes this.
  6. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    I already read what Ryiah stated and I'm clear on that. I'm just putting a suggestion to the Unity team, not to you. I'll try the removal steps later.
     
  7. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,754
    As been said, you need to write posts in designate forum sections, not in general. Otherwise most likely, no Unity dev will read it.
     
    MadeFromPolygons likes this.
  8. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    I put it in general because this is a suggestion. Can someone help move it to help?
     
  9. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    You still didn't understand what people are saying. You can do what you're asking for already;

    Don't need particle systems?
    upload_2022-1-24_10-25-36.png

    Don't need TextMeshPro?
    upload_2022-1-24_10-26-32.png
     
  10. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    Thanks @Baste ! I could not be bothered to screenshot stuff because from previous dealings on here, I honestly did not expect this user to actually do anything suggested so I thought it was a waste of time :D

    But what @Baste has posted basically sums up everything everyone is saying here very clearly - this suggestion is pointless OP because you are asking for something that already exists :)


    General discussion is not for suggestions to the team though... Can you imagine how much time and effort it would take to gather "suggestions" this way? Better off suggesting in the section relevant to the suggestion in the future (in this case it wouldnt matter as unity team members will say the same as everyone else - this feature already exists ;) )
     
  11. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    Yes I've already gone to the package and removed what I don't want and it works. Thanks anyway.
     
    MadeFromPolygons likes this.
  12. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    Yes Thank you. Done. I did before seeing your post.
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Correct, please use Package Manager to add, remove and upgrade your packages.
     
  14. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    @JeffDUnity3D, It would be nice if it can be done manually too. That's all I wish to say.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I understand what you are saying, but we would not be able to support random deletion of files that may have other references and/or dependencies.
     
  16. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    You can do it manually by removing the lines from the Packages/manifest.json file.

    The files shown under Packages/ in the Project view are immutable - so if you remove or change any files in there, Unity undoes that and restores them. That's because the manifest file specifies that the files are supposed to be there.

    What Unity could do is that if you selected a folder in the Packages folder, and hit delete, instead of giving the warning message:
    upload_2022-1-26_9-52-58.png
    It could say something like "these files are read-only, use the package manager to remove them from the project if you want to remove them".

    In general somebody should go around to every Unity engineer and put a post-it that says "actionable error messages" on each of their monitors. Unity is pretty bad at warning/error message texts throughout the entire code-base, and has pretty much always been.
     
  17. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    Is this what is normally done? Are you sure the files won't return again? Have you tested it with the latest LTS version? How do you know the results would be the same in future LTS versions? You are not involved in the development of Unity, it's the team.

    Did you see @JeffDUnity3D's reply? It looks to me like removing it manually is not a good idea.

    Anyway I will play around with a test project later when I have time to see the results and check the size to see if it's worth removing unwanted items.
     
  18. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,754
    Manifest.json is just a json file config, with realitevely few lines of code, which describes which packages are used.
    And while you can edit by hand, it is better to use package manager. It does more less the same thing, as PM writes to the manifest.

    Unless you are more advance Unity user, you better of not to tamper with manifest.
     
  19. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    I mean, I don't 100% know, in the same way that I don't 100% know that scenes added to the build settings are included in builds, or that fairies doesn't exist.

    But that's how it's supposed to work, and it's how it's functioned for a few years at this point.
    As @Antypodish said, the package manager is just a fancy interface for the manifest. The manifest is approximately equivalent to how importing online packages are done in other frameworks and languages.

    You're the person who thought Unity was the only framework that needed version control, right? It seems like your initial reaction to everything that you don't quite understand yet is "Unity must be insane".
     
  20. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    That's ok. For now I'll just use the package manager. I'll check the json file at a later time when I feel I have time.