Access member in TArray from FHitResult array

Hi,
I’m currently trying to access the location variable form a FHitResult.

//My Array    
TArray<FHitResult> MyHitResults;   
//Emtpy Initialisiation
FHitResult empty;
MyHitresultsNew.Init(empty, numRays);

// Gets filled somewhere else
FVector Location1 = MyHitResuls[0].Location

The part with FVector doesn’t work,…

Does someone know the answer for my problem? It is just one little mistake I think :slight_smile:

I’d remove the Init call and just let UE dynamically allocate the memory as needed, see if that fixes your issue. Otherwise I’d need to see the code where you are adding elements into the array.