FVector vector =Array[i,i+2];
Should be:
FVector vector =Array[i,i+1,i+2];
FVector vector =Array[i,i+2];
Should be:
FVector vector =Array[i,i+1,i+2];
I have a long TArray and I want to split into multiple FVector. Here is my Code :
TArray<float> Array;
Array.Init(1,1000);
for(int32 i=0; i<Array.Num();i = i +3 ){
FVector vector =Array[i,i+2];
Function(vector);
}
I get these errors:
**error: expression result unused [-Werror,-Wunused-value]
FVector vector = Array[i,i+2];
error: no viable conversion from
‘TArray FDefaultAllocator>::ElementType’ (aka
‘float’) to ‘FVector’
FVector vector = Array[i,i+2];
Any idea how to solve it?
I still get the same error.
Do you want something like:
FVector myVec = FVector(Array[i], Array[i+1], Array[i+2]);
The errors in your code are:
Also note that FVector expects 3 values, not 2 as in your code (FVector2D will expect 2 values)