Loading assets from a pak file

Well I found a hacky workaround…



PakPlatform = reinterpret_cast<FPakPlatformFile*>(const_cast<void*>(FCoreDelegates::OnMountPak.GetDelegateInstance()->GetRawUserObject()));
auto gameDir = FPaths::GameDir();
FPaths::MakeStandardFilename(gameDir);
PakPlatform->Mount(*mapPath, 4, *gameDir);


The problem is that the mount path set internally does not work for me. This allows me to explicitly set it to gameDir which does work. I would like to find a better way to get the FPakPlatformFile* since this method is very fragile, but it does work.

Hope this helps someone, and that this isn’t necessary in the future.