Getting UTexture*, but not in constructor

WarpSpider833
Thu, 05 Jul 2018 11:42:46 +0000
Rendering

I need to find a UTexture pointer, but I’ve just realize that I can’t do it in the constructor. Until now I’ve been using:

FString Path = TEXT("/Path/..");

static ConstructorHelpers::FObjectFinder<UTexture> TexReference(*(TexPath));

UTexture * Texture = TexReference.Object();

Trouble is, I’ve just discovered the hard way that ConstructorHelpers::FObjectFinder only works in the constructor (not surprising really, considering it’s name!). Is there a way to do this elsewhere? I think it’s possible with LoadClass, but I can’t get it to work.

Thanks

3 posts - 1 participant