- Home /
Why does my Unity project contain tens of thousands of files when the actual game assets is far less?
My game has maybe 50 textures and 30 prefabs, and that's about it, but the actual Unity file is over a gigabyte in size and contains tens of thousands of files, so when I try to copy the project as a backup it takes absolutely ages.
Why does a very simple Unity project have tends of thousands or random files that seem to be in there basically by default?
Edit: Part of answering my own question is that I'm using Standard Assets and Oculus Controller stuff--although the entire Assets folder for the project is still on a couple hundred MB--so will Unity at least ignore any of that stuff I don't use when it builds the game for other people to actually play? Also, is there a way to easily be able to delete any stuff myself now that isn't being used from those things (as in an easy way to know what can be deleted that won't break the stuff I am using)?
When you copy your project as a backup, ignore anything under /Library/ and /Temp/ , as those are generated files by Unity. This is why your project is many times larger than it seems. Anything under /Assets/ are files you've imported manually. Be sure you have Visible $$anonymous$$eta Files turned on under Editor Settings before you do this though
Oh, and if you need any other questions answered, just lemme know. You can reach me on Skype at: live:awesomesupport_1 and I'll try to help.
Answer by jtok4j · Aug 22, 2018 at 06:52 PM
Greetings, Good to hear that you're well on the journey to completing your project!
Yes, Unity will cut out anything residing in the project which it isn't going to need for your game/app, when it gets built. (Example: My Noah's Veggie Run project is ~ 1GB, but shrinks down to 54 MB when built for Android. )
There are several tools on the Unity Assetstore to scan your project, and will point out to you which assets are not needed at all. Some of these might be: Asset Hunter 2, or This Project on GitHub. Good luck and... Keep on Creating!
Justin of JustinTime.Studio
Cool. Thanks for the quick response. I'll do a little bit of cleaning up myself then but not worry too much. And I'll have a look at one of those tools because I'd really like to go in and delete any of the Standard Assets and Oculus stuff I'm not using at all, just to keep the project tidy and easily manageable, but I know some things are used by a couple of the objects in my game/scene that I'm not really aware of and a whole bunch of errors will crop up if I just delete stuff I assume isn't necessary.
And, by the way, it's funny you've made a game about Noah, as I'm making a first person VR game that just happens to have some religious-type stuff in it too, with a priest who goes around with a cross and holy water killing demons, a bit like the Exorcist. $$anonymous$$uch like the recent Exorcist game that just came out for VR too. Oh the fates! :-o lol Well, at least my game is a more lighthearted and cartoony take on the whole exorcism concept.
Answer by Ebonicus · Nov 08, 2020 at 04:18 PM
Not to resurrect, but this came up for me as well, and this is very high on google. For those who still land here...
When you backup, just exclude *.bin there are 100,000+ shader variants which Unity can build if you need to do a restore.
Just a few days into unity3d. But is it possible to exclude the Library folder? And when you need a backup just regenerate the files from the Assets folder?
Your answer
Follow this Question
Related Questions
Store and access a level file with my project 1 Answer
Assets folder. Can I manage files from my OS level? 3 Answers
How can I load an custom file from the Assets folder? 2 Answers
How to load objects from a file outside of unity3d 3 Answers
Difference between Resources folder Vs normal folder 0 Answers