# Appending FVector to another FVector

**URL:** <https://forums.unrealengine.com/t/appending-fvector-to-another-fvector/446305>\
**Category:** C++\
**Tags:** tarray:-arrays-in-un, unreal-engine, UE4, CPP, question\
**Created:** [March 31, 2019, 12:44am UTC](https://forums.unrealengine.com/t/appending-fvector-to-another-fvector/446305 "2019-03-31T00:44:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![astrotan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@astrotan](https://forums.unrealengine.com/u/astrotan)\
**Post date:** [March 31, 2019, 12:44am UTC](https://forums.unrealengine.com/t/appending-fvector-to-another-fvector/446305/1 "2019-03-31T00:44:07Z")

</div>

Hi, what I’m trying to achieve is creating a TArray of FVectors (named R\_ijk) from the first element in a TArray of Existing FVectors (called TempState). TempState holds position FVectors and velocity FVectors so basically I’d like to create a separate TArray with **just** the Position information. Here is my code.

.cpp

```
void ASatellite::BeginPlay()
{
	Super::BeginPlay();

	FindSemiLatusRectum(SemiMajorAxis, Eccentricity);
	
	TArray<float> temp = CreateNuArray();

	TArray<FVector> TempState;

	for (int i = 0; i < temp.Num(); i++)
	{

		TempState = COE2RV(p, Eccentricity, Inclination, RAAN, ArgOfPeriapsis,temp[i]);
		
		R_ijk.Append(TempState[0]); // Here is where Im getting the error 
		V_ijk.Append(TempState[1]);
	}
	
	for (int i = 0; i < TempState.Num(); i++)
	{
		UE_LOG(LogTemp, Warning, TEXT("Final State Vector %s"), *TempState[i].ToString());
	}
	
}

```

.h

```
// Final State Vectors in IJK frame
TArray<FVector> R_ijk;
TArray<FVector> V_ijk;

```

The error given is: "Severity Code Description Project File Line Suppression State  
Error C2664 ‘void TArray\<FVector,FDefaultAllocator\>::Append(std::initializer\_list)’: cannot convert argument 1 from ‘FVector’ to ‘std::initializer\_list’ TableTopSat G:\UnrealProjects\TableTopSat\Source\TableTopSat\Satellite.cpp 30   
"

Any help is really appreciated!

---

<div class="post-metadata">

**Author:** ![astrotan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@astrotan](https://forums.unrealengine.com/u/astrotan)\
**Post date:** [March 31, 2019, 3:55am UTC](https://forums.unrealengine.com/t/appending-fvector-to-another-fvector/446305/2 "2019-03-31T03:55:47Z")

</div>

For those having similar issues, here’s how I ended up solving it. Insert, instead of append worked for me.

New code. .cpp  
for (int i = 0; i \< temp.Num(); i++)  
{

```
		TempState = COE2RV(p, Eccentricity, Inclination, RAAN, ArgOfPeriapsis,temp[i]);
		
		R_ijk.Insert(TempState[0], i);
		V_ijk.Insert(TempState[1], i);
```
