If you simply need to get the array, you can use this:
.h: TArray<FTransform> GetTestTransform();
.cpp:
TArray<FTransform> AStaticGroup::GetTestTransform()
{
TArray<FTransform> NewArray;
NewArray.Add(StaticMesh1->GetActorTransform()); // if meshes are actrors; if they are components, use GetComponentTransform();
NewArray.Add(StaticMesh2->GetActorTransform());
return NewArray;
}
If you need it to be with an out parameter, like in your case, then:
.h: void GetTestTransform(TArray<FTransform> &NewArray);
.cpp:
void AStaticGroup::GetTestTransform(TArray<FTransform> &NewArray)
{
NewArray.Add(StaticMesh1->GetActorTransform());
NewArray.Add(StaticMesh2->GetActorTransform());
//that is if you passed an empty array as a parameter. If you already initialized the array with 2 elements, just set its elements.
}
Thank you sir for reply, I have a question, GetActorTransform() will get the worldtransform of the actor? actually I am spawning the actor in the level on a defined world location.
I am asking because the node GetWorldTransfom is returning GetComponentToWorld() under scene component.