// .h
TArray<class UInstancedStaticMeshComponent*> TileMesh;
// .cpp
TileMesh.Add(CreateDefaultSubobject<UInstancedStaticMeshComponent>(TEXT("TileMesh")));
I don’t really understand why but the add here crash’s the editor.
// .h
TArray<class UInstancedStaticMeshComponent*> TileMesh;
// .cpp
TileMesh.Add(CreateDefaultSubobject<UInstancedStaticMeshComponent>(TEXT("TileMesh")));
I don’t really understand why but the add here crash’s the editor.
Putting subobject in array may not be supporter, check logs in Saved/Logs in project directory it should have some info on what you doing wrong, crashes from component errors are usually quite discriptive
Thanks I didn’t think to look at the logs.
For other people, the problem was I was adding multiple components in a loop with the same name so I set the name based on the loop and it worked.