Download

Relative asset path to .pak asset path

Hello there,
I seem to be struggling to find an asset I have no problem loading within the editor, in a packaged game.
In the editor I simply load a soundwave given a path :

FString Path = "SoundWave '/Game/" + PathFromContentFolder + "/" + FileName + "." + FileName + "'";
return Cast<USoundWave>(StaticLoadObject(USoundWave::StaticClass(), NULL, *Path));

so basicly with a path being the class type + ‘/Game/Sound/hellothere.hellothere’ (it’s what we call the relative path right ?)

This method works perfectly fine in the editor but I can’t seem to find a solution to make it work using a .pak file. Do I have to mount it then search within it ? Isnt there any other solution ?

Thanks a lot for your help

Mael

I really don’t want to mount my .pak every time I need to load an individual asset, seems a bit too intensive for the purpose.

Seems like it just needed to have the path without the class type in front, no .uasset in the end and that the asset actually was in the .pak file. I discovered today that it wasnt included by default and need to be referenced inside the game OR added to the package list : Additional Asset Directories to cook. Hope it helps someone out there !

Hey, It’s funny i have your problem but in reverse. I have no problem loading asset in a packaged game, but not within the editor. FStreamableManager can’t find the asset inside.
pak files mount successfully.