Why does "Export Package" function include assets that are not required?

Is it a bug in the Engine itself or is there a reosonable explanation to this? For example it’s quite time consuming when I export a package from a project that has 1000+ assets, you have to uncheck everything by hand and makes the function useless in its current state. This issue has been annoying me since Unity ~4. Every once in a while I’d like to make asset backups, using the Export Package function.

Thank you for your attention!

Have you tried unchecking “Include Dependencies” at the bottom?

1 Like

Yes and then it only exports the single selected file, this I can also do with a regular OG copy/paste move by myself. I would like to use the function the way It is ment to be designed.

1 Like

Everything’s working as it should on my end. All I had to do was select the folders and/or files that I want to export, right click, choose ‘export package’, uncheck ‘include dependencies’ and then only the files/folders that you selected in the project view will be selected, then finally click export.

2 Likes

There’s probably a reference somewhere in a selected object that causes all the other items to be selected. Internally, Unity has to build a graph to figure out dependencies. It’d be nice to be able to view that graph, to figure out which objects causes which other objects to be required.

8 Likes

Select the object you want to export, right+click and select “Select Dependencies”. Then right+click on the selected items and select “Export Package”. In the export window, uncheck “Include Dependencies”. This will export a package using only direct dependencies.

25 Likes

Thanks yeah, that’s a workaroud. But the include feature is indeed a bit messy, because even if my scene or the prefab does not include a dependency, it still includes it… at somewhat random and this is not how it should be. I think it might be a bug in the graph mentioned by Baste

1 Like

Greetings,
The solution to this, is to bend your mind around how the engine’s export feature is made.
Actually, there is a separate menu for selecting your desired asset (for exporting)'s dependencies.

From the Project window: Right click on the asset you want to export. Choose “Select Dependencies” , you’ll notice the window updates with a bunch of dependant files. Then right click again on one of these files and choose “Export Package”.
You’ll see the export window load with every file in the project… now un=check" include dependencies, and you’ll see the list update to include only the original asset and it’s dependant files.
Good Luck!

4 Likes

I agree this is totally ridiculous, ive made a tiny scene in my game for another project, when I go to export it includes THOUSANDS of files ive not referenced at all. Including entire assets and tons of code etc, why cant unity work out that none of this is in use. And as someone said, if it is in use Id like to be able to see where and how. Basically a bug in export package imho. Ps, I dont want to select the files/folders manually I want to give unity a scene and let it work it out. Mostly because my project is huge and messy and ive used things from all over, theres over a million files. Doing anything manually on a large project is hell.

Edit, package is 1.2 gig, which is a lot less than my proj (200gig) but I estimate it should only be about 300 meg in reality. I wonder if they will fix this, though I assume when you make a end build, nothing that is redundant is included, so not the end of the world, just a bit confusing and wasteful…

This almosted worked, but unchecking the “Include Dependencies” option left lots of stuff behind. In the other hand just selecting the asset and trying to export package brings almost everything inside the project.

What worked for me was:

  • Select the prefab => “Select Dependencies”
  • Right+click on the prefab item => “Export Package”
  • Leave the “Include Dependencies” checked
5 Likes