Probably an easy flag for cooking or force-loading I overlooked somewhere, so here goes.
I have a widget system that relies on textures and knowing where what exists. On BeginPlay I use Asset Registry and ‘Get Assets by Path’ to create an array of all textures in a given path, so I can access it from the widgets.
All works well, but when playing in standalone mode or packaged, the array will only include textures that are initially used in the level, not all in the path. They seem to simply not exist. Set the directory containing the textures to always cook, but no dice. Any flag I need to set or way to force all textures/assets to be used in the game, even the ones that are initially unused in the world?
Sorry, never really figured it out.
Went with a slightly different approach where things at least work in built form for shipping.
Running standalone still doesn’t work, but figured that’s just a limitation of how standalone mode handles assets. So for testing I just play in editor.
Whatever I am doing wrong, it did not work for me.
But this worked for me:
In Project Settings search for: Additional Asset Directories to Cook
add an element to the list and paste the path you want to be cooked when packaging
you can copy the path from the asset browser. When you click on the right side of the box that displays the path it should turn it into a string that can be copied. It should look similar to this: /Game/MyAssets
click path to the list:
Edit > Project Settings > Project - Packaging > Packaging - Advanced - Additional Asset Directores to Cook
An indicator that it cooked the directory is, when it appears in the saved directory: <YouProject>\Saved\Cooked\<TargetPlatform>\<YourProject>\Content