When trying to load in a Data Table within my UUserWidget class the program breaks out within the TObjectFinder function, see image below
I have tried calling TObjectFinder outside my NativeConstruct.
#include "ShopWindow_UI.h"
static ConstructorHelpers::FObjectFinder<UDataTable> dataTable(TEXT("DataTable'/Game/Inventory/Items/DataTable.DataTable'"));
void UShopWindow_UI::NativeConstruct()
{
if (dataTable.Succeeded())
{
itemDataTable = dataTable.Object;
}
}
And inside NativeConstruct.
#include "ShopWindow_UI.h"
void UShopWindow_UI::NativeConstruct()
{
static ConstructorHelpers::FObjectFinder<UDataTable> dataTable(TEXT("DataTable'/Game/Inventory/Items/DataTable.DataTable'"));
if (dataTable.Succeeded())
{
itemDataTable = dataTable.Object;
}
}
I’m not sure what is causing the issues as I have looked at similar uses of the TObjectFinder online and mine matches their use. It could most likely be a simple misunderstanding that I’m not noticing.
Thanks