Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Soareverix · Sep 07, 2020 at 07:14 AM · guisceneassetssizebuild settings

Does removing scenes from build settings reduce the file size of a game?

I have a project with quite a few assets, but it would be a pain to go through and figure out exactly which ones I need for my game to run. I've unchecked my testing and debug levels from the build settings but I don't know whether or not I should remove them entirely and whether that would make my game take less file space.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Bunny83 · Sep 07, 2020 at 08:05 AM

No, you don't have to remove your testing and debug scenes from the build settings. Unchecking should be enough so they are not shipped with the game. Actually if you look closely only the checked scenes get a build index. You can also verify this by checking which scenes are available in the SceneManager.

Unity be default only includes assets that are used somewhere, either directly in a scene or indirectly by something that is referenced from something in one of those scenes (like prefabs, materials, meshes, ...).


The only exceptions for this rule are any "Resources" folders in your project. Assets inside a Resources folder are always shipped with the game since they can be loaded through Resources.Load by their name, so Unity does not know which you might need or use. The second thing is the StreamingAssets folder. Anything you put into that folder will be shipped with your game "as it is". Unity will not import any assets from this folder. Unity just ship that folder with your build game. On most platforms this is an actual subfolder in your build directory. However on some platforms (like Android) the streaming assets are packed into the APK file. Lastly there are some settings panels in the PlayerSettings where you can reference certain assets. This could be a list of shaders, the application icon, splash screen assets, etc.


Apart from that nothing that isn't "used" / referenced from any scene, other included asset or from any settings panel will not be shipped with your game.


Note that this is only true for "assets". Scripts on the other hand are all included since the whole codebase is compiled into one or multiple assemblies which are shipped with your game. Code stripping might remove "some" things, but I wouldn't rely on that. Of course any editor code is not shipped with your game since editor scripts are compiled into a seperate assembly that is only used in the editor.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Soareverix · Sep 08, 2020 at 05:18 AM 0
Share

Thank you so much! I did not know that assets in the "Resources" folder are always used. I actually named my main folder without being aware of this property so it must have resulted in importing tons of unused assets! Super helpful answer!

avatar image
0

Answer by Soareverix · Sep 14, 2020 at 11:19 PM

I found two errors in my game that were significantly increasing the size. One was that I had a folder named Resources with a bunch of prefabs in it. The second reason, however, was much more significant: while doing level design, I had duplicated my scene with a baked lightmap in it. Even though I'd deleted all of the static objects, the lightmap folder had also copied (in another folder) so that was why my game was taking up so much space. After resolving the lightmap issue, my game size dropped from 1.8 GB to ~400 MB. Massive improvement. Hope this helps someone!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

260 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[HELP} Asynchronous loading assets after loading scene 1 Answer

Changing start scene gui size main menu 0 Answers

Build configuration of choice is not activate/synchronized with the current level layout 0 Answers

how big is my app size 2 Answers

Skinned/unskinned GUI controls size differences 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges