Missing some Data Assets in package

Hi, I hope you’re doing well !

For short, I’ve Data Assets which I use in my game scene (ex: DA_Upgrades I put in the upgrade list of a BP_Machine in my Map). Some of these Data Assets just disappear or loose their path when I package the project. I work in a full blueprint project.

The strange thing is that if I set the starting Map as the one which holds my Data Assets everything is fine. But if I do otherwise (like starting from a menu), they aren’t there.

I have tried everything like Full Rebuild, changing build configuration, adding the data assets directory to the “Additional Asset Directory to Cook” but no results.

After crying a lot, I chose to update my project to 4.26 to see if it was a version-related bug. It did work but just for some time. The problem came back to haunt me.

I am not alone, there are similar issues in the Unreal Slacker’s packaging channel, 1 similar topic in the website and a ticket

If someone has some clue of what’s going on, I would give him a virtual hug.

I’m not sure why this ticket was marked as fixed, I’m having the same issue and its a nightmare.

Have the same issue dingding.

Just ran into this issue. The solution is simple but you have to understand how the building process works.

Everything in the engine is basically a class. These classes then reference each other, for example by containing a variable into which you placed one of your data assets, and you end up with a whole hierarchy of references. A reference basically tells the engine, “Hey, I’m gonna need this class at some point”.

I will give you an example. Let’s say that you have a map. That is the base where the hierarchy starts. Then on the map, you have an actor that has a static mesh component. So the map is referencing the actor and you have two references in the hierarchy. Now let’s say that the actor has an array variable into which you want to place some data asset that contains a mesh. On event being play, the actor will randomly choose one of the data assets and set the static mesh component in the actor to the mesh in the data asset.

But for now you haven’t added any data assets to the array variable. You just have the map, the actor on it and a bunch of data assets in a folder.

You build the game, use the asset registry to loop through all the classes and you notice that your data assets ar missing. Well, that’s because they weren’t referenced by any other class and the build process didn’t include them into the game to save space.

Now if you go back into the actor some of the data assets to the array variable, they will be referenced and you reference hierarchy will contain the map, actor, and the data assets that you added to the array variable.

Now if you build the game and loop through all the classes again, you will notice that the data assets you added to the array variable are found, and the ones you didn’t are missing.

So, if you aren’t going to reference the data assets anywhere but intend to access them at a later point in time, you need to tell the engine to include them in the build even if they are not being referenced.

Go to your project settings > packaging > under the section “additional asset directories to cook” click the plus icon and add the folder containing your data assets. Now any files in this folder will always be added to the build.