UTexture2D* DynamicTextureLoad = LoadObject<UTexture2D>(GetTransientPackage() /*Or whatever you want to be the outer/owner of this asset*/, AssetPath);
if (DynamicTextureLoad)
{
// ...
}
In this case, the asset path part “TextureFolder/AssetName” is stored in the FString array.
It seems that ‘*FString’ gives you that TCHAR stuff that TEXT() really likes… I tried and at least no error.
ConstructorHelpers can only be executed in the constructor of a class when you know the path at compile time. So, if you already know that asset - then that’s fine, but if you don’t then you’ll need to use LoadObject.
If you’re asking how to concatenate the string, then it should be simple.
I was just wondering if *FString would indeed return the desired data and not some nonsensical values.
But yeah, I can only use this in a constructor. Not exactly where I need it, but in another scenario it will come in handy.
So Im reading into how to use LoadObject