In some projects, when we are working with a lot of assets, we may need to be able to programmatically get one/load one using its path. This happened to us when we were working on a big project, in which we had a lot of assets automatically imported from FBX files and we needed to be able to instantiate them using their name at runtime.
In this short tutorial we present how we’ve managed to do it, and especially how we were able to programmtically load an asset by its path.
We had to create a blueprint to specifically load one asset or another by specifying its name. We decided to use a Datatable in which all assets informations are stored including its path in the project and its name.
Finally, we used the AssetRegistry to load the asset and get a reference using its path. Here’s how it’s done.
The AssetRegistry
The AssetRegistry is an editor subsystem which gathers information about unloaded assets asynchronously as the editor loads.
This information is stored in memory so the editor can create lists of assets without loading them.
The Content Browser uses the AssetRegistry while we are developping with the UE editor. But, we will use the AssetRegistry system to load files once the game is packaged.
First, we have to get the AssetRegistry by calling the corresponding Blueprint node :

You can see here all the functions provided by the AssetRegistry. For this tutorial we’ll only use the GetAssetsByPath function but you can explore and try to use the others by your own.

GetAssetsByPath
For our project, the StaticMesh we want to load will all be located in a particular folder. We will retrieve all assets in this folder and then filter them by name or type.
We fill the “PackagePath” using the path where the assets are located. In the present case (cf. the screenshot below), it is “/Game/Meshes/Train”.
In this example (we are in debug mode), we can see the list of assets retrieved by the function.

Deal with assets data
We can now iterate on our assets and find one (or more) assets which fit our needs. In the example below, we try to find a StaticMesh matching a particular name. Once this asset found, we can get it and cast it to the wished type to use it.
This quick introduction to how we can use the AssetRegistry to get references to unloaded meshes is over.
Of course you can explore by your own all the functions in the AssetRegistry.
If you only need to get one particular asset by its name maybe the GetAssetByObjectPath function may be enough.
Also, remember to configure Unreal to include these dynamically loaded files into the packaged game if you want to be able to load them at runtime.
And as always, if you want to know when the new articles are out, you can follow us on Twitter and Facebook.
Good luck 😉

I find this handy as I want to do the same but I have a quick question – in ‘SetStaticMesh’ node, what goes in input node ‘Target’? It is not shown on your screenshot.
64betlogin seems like a decent option for betting. I like how easy it is to view the matches and bets. Check them out at 64betlogin.
If you’re trying to get logged on, 3jllogin is your spot. Very easy to sign in and get started. Defitnitly worth signing up 3jllogin
Thinking about trying ‘chơi lottery 92’ since a local friend recommended it. Anybody had good experiences here? Learn more: chơi lottery 92.
I need to to thank you for this very good read!! I certainly loved every little bit of it. I’ve got you book marked to look at new stuff you
These are genuinely impressive ideas in on the topic of blogging. You have touched some pleasant points here. Any way keep up wrinting.
QQ88sprachrei is a good option for a reliable site to play at. I’ve found their service to be dependable. Take a look at: qq88sprachrei.
These are really wonderful ideas in concerning blogging. You have touched some nice points here. Any way keep up wrinting.
I enjoy what you guys tend to be up too. This sort of clever work and coverage! Keep up the terrific works guys I’ve included you guys to my personal blogroll.
I was recommended this web site via my cousin. I am not certain whether this submit is written by him as no
one else recognise such detailed approximately my difficulty.
You are wonderful! Thank you!
I am sure this paragraph has touched all the internet viewers, its really really nice piece of writing on building up new webpage.
I am sure this article has touched all the internet users, its really really fastidious piece of writing on building up new weblog.
Hello, i think that i saw you visited my web site thus i came to “return the favor”.I’m attempting to find things to improve my web site!I suppose its ok to use a few of your ideas!