How to load assets from a pak file at runtime?
Now I have a pak file, which contains some .uasset files. I want to load the .uasset files at runtime but the code doesn't work right. The code is as below:
It seems the mount step is successful, but when it runs to ObjectLibrary->LoadAssetDataFromPath(MountPoint), it is not fully loaded belong to the log, and ObjectLibrary->GetAssetDataCount() returns zero.
Also I've tried other ways:
it could not load the assset file BR_DongChenMingHan_6.uasset to string. So I'm not sure whether the mount step is successful? And when loading the asset using StaticLoadObject, It logs "can't find object" and I am really confused about this log for the file path seems correct. The related log is as below:
It's very kind of u if anyone teach me the right resolution, for I've spent several days on this problem.
I have just solved this problem.
The key is the asset's path.
Remeber,When you are using the StaticLoadObject method.
You path should be Path1/Path2/Pathxx/AssetName.AssetName
Instead of AssetName.uasset or AssetName.umap...
try to change the path and let me know if you solve this problem
Here is my code,and it worked correctly!!
answered Sep 30 '16 at 07:07 AM
I don't understand why you use LoadFileToString. Why do you want to load a uasset into a string ? Maybe this is because I don't use FStreamableManager but I would build this way :
Also I don't understand why this line don't return any log :
Are you sure that you have uasset files into your pak file ?
answered Dec 17 '15 at 01:29 PM
answered Jan 03 '16 at 11:25 AM
When I put the .pak file on default folder "./Content\Paks" and application init for the first time it load the asset and I can use it. But if I drag and drop another .pak file to the same folder during runtime, the application don't load the content to memory. Even if I code an explicit method to do it.
It's possible to replicate the behaviour of loading a *.pak file content at init() method during runtime ?
answered Mar 02 '16 at 07:56 PM
answered Jul 17 '16 at 12:41 PM
Guys please help!
answered Feb 20 '17 at 01:55 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here