Hello there,
I am currently trying to load a PakFile from a location on disk during runtime. My current approach is adapting this plugin for UE 4.27.2 :
However, I’m running into a bizarre issue when trying to access FPakFile’s Constructor:
FPakFile
(
IPlatformFile * LowerLevel,
const TCHAR * Filename,
bool bIsSigned,
bool bLoadIndex
)
Whenever I try to access it, it seems like the VS wants to access FPakFile’s private destructor instead, giving me the following error:
In the image below, you can see that there is a publicly available constructor, as well as the private destructor that is getting referenced instead.
I have also attempted to access FPakFile’s constructor in another class outside of the AsyncPackageStreamer plugin, just to see if there was something I was doing wrong when I updated AsyncPackageStreamer.Build.cs, but I found that I got the same error there as well.
Here is how I am attempting to access the constructor:
// Make sure the Pak file is actually there
FPakFile PakFile(PakPlatform.Get(), *FilePath, bSigned, true);
if (!PakFile.IsValid())
{
Unlock();
UE_LOG(LogAsyncPackageStreamer, Error, TEXT("Invalid pak file: %s"), *FilePath);
return false;
}
Here is PakPlatform’s Declaration:
TSharedPtr<FPakPlatformFile> PakPlatform;