I’m trying to initialize and fill an array of structures to a given N size with empty structures to be used. Init would not accept both NULL and ‘{}’ for the element to fill it with.
2 Likes
When initializing an array, you need to indicate the values with which the elements will be initialized. In your case you have an array of structs, where struct element is also an array. So you need to indicate that in your Init():
TArray<FMaterialsArray> Tmp;
TArray<UMaterialInstance*> emptyMats;
Tmp.Init({emptyMats}, 10);
3 Likes
Thank you so much!
@Tuerer Huge thanks! Helped me avoiding limbo with array out of bounds 0 of 0