i’ve been trying to store data table references in structs and Tarrays so i can access them in multiple classes, functions etc, but i’ve been having problem with storing the references in both the structs and arrays, example code below
Arrays
.h file
TArray DT;
UClass()
class UMrClass{
UMrClass();
}
.cpp file
UMrClass::UMrClass(){
static ConstructorHelpers::FObjectFinder Test(TEXT(“/Game/Path/TestDT”));
if (Test.Succeeded()) {
DT.Add( Test.Object);
}
The above code dosen’t work
Structs
.h files
UStruct()
struct FTester{
class UDataTable* Test;
FTester();
}
.cpp file
FTester::FTester(){
static ConstructorHelpers::FObjectFinder Test(TEXT(“/Game/Path/TestDT”));
if (Test.Succeeded()) {
Test = Test.Object;
}
}
FTester DT;
wasn’t able to access members through the above object
TArray ADT;
Wasn’t able to access the member through the above array
if any one can explain how to store references in structs or arrays and if possible cleaner way to access the members in a struct then the const method way, since i need to store alot of references