I have a little code snippet in UE4 c++ that is supposed to give me a bunch of FVectors in a grid.
However, printing out the FVectors gives me (0,0,0) every single time
FVector deltaLoc;
float xGap = 150;
float yGap = 150;
for (int i = 0; i < rows; i++) {
//FCellRow row;
for (int j = 0; j < columns; j++) {
UE_LOG(LogTemp, Warning, TEXT("I, J: %f, %f"), i, j);
UE_LOG(LogTemp, Warning, TEXT("newX, newY: %f, %f"), xGap * i, yGap * j);
deltaLoc.Set(xGap * i, yGap * j, 0);
//deltaLoc.X = xGap * i;
//deltaLoc.Y = yGap * j;
UE_LOG(LogTemp, Warning, TEXT("DeltaLoc %f %f %f"), deltaLoc.X, deltaLoc.Y, deltaLoc.Z);
}
The output looks like
LogTemp: Warning: I, J: 0, 2
LogTemp: Warning: newX, newY: 0, 300
LogTemp: Warning: DeltaLoc 0 0 0
for all values of i and j. The first two log lines work fine. The third one stays the same.