Assets not being used getting built into the game

So I used quite a few asset packages when building my game, mostly the scripts from them. But when I go to build my game, it seems like ALL the textures and sprites from the other asset packages are being included even though I am not using them. I have checked all the gameobjects, have used Find Reference 2 (from the store) and I cannot find any link from the files being included and my game. All in all it’s about 400 mb worth of PNG that makes my phone game much bigger than it should. I have been able to deal with this by ignoring the folders in cloud build but I’m not sure how to go about it in the build from Unity.

I would like to remove the files from being included in my build without me having to delete the files, thanks. Any help would be appreciated.

Are they in a [Resources](https://docs.unity3d.com/ScriptReference/Resources.html) directory? If so they will be built into the package.

Also Unity will always build in all scripts even if they aren’t used.

-sam

No they are not in a resource folder. For instance, one package I am using is Infinite Runner Engine, and all the PNG in Assets/InfiniteRunnerEnginer/Demos/Minimal/Sprites are being included in the build. But I have ~8 other packages which are also including their png images

That’s very weird! I use Find Reference 2 and it generally is pretty accurate. One thing you could try doing is tracking down the dependencies manually yourself by searching through your entire project. This only works if you’re using text assets though. So you’d search for the png guid (which you get from the .meta file) in your project. Probably that would be referenced by a material or a GameObject maybe in a prefab so you might have to search for that guid as well to find what is using that, etc, etc. Painful but brute force last resort.

-sam