Hi,
I have this code so far putting together what I’ve learned from a couple of tutorials regarding datatables. I’ve successfully created the datatable and can access its contents but I need to loop through the entire table at a specified frequency. I’m assuming that taking the data and putting it into a 2D array, then looping through that array is the best way to go about that. Here is my code for creating that array called PositionArray
TArray<FCSVTableReader> PositionArray;
FString ContextString;
TArray<FName> RowNames;
RowNames = DataTable->GetRowNames();
for (auto& name : RowNames)
{
FCSVTableReader* Row = DataTable->FindRow<FCSVTableReader>(name, ContextString);
if (Row)
{
PositionArray.Add(*Row);
}
}
This compiles correctly but when I try to access the contents within PositionArray nothing seems to work. Any ideas? The TArray type seems odd to me, an array of a struct? I’m not sure if that changes anything when trying to access the contents though.
For reference my table looks like this
, x, y, z
0, 0, 0, 0
.5, 1,0,1
1, 2, 1, 1.5
etc....
Here are the tutorials that I have referenced:
https://forums.unrealengine.com/editpost.php?do=updatepost&postid=732090