I’m working on a chunk generator actor and I’m pretty new in C++ so I’m having some problems…
I want to let myself add Instanced Static Mesh Components in the BP, so I tried this:
but it doesnt seem to work, “undefined” so I changed it to static meshes and then in OnConstruction I tried creating the actual instances component from this array but it’s still “undefined”…
int S = 0;
while (S < StaticMeshes.Num()) {
InstanceMesh[S] = NewObject<UInstancedStaticMeshComponent>(this, name);
InstanceMesh[S]->RegisterComponent();
S++;
}
Are you sure InstancedStaticMeshComponent.h is not in some subfolder? You need to provide the exact path if it’s not in UE/Runtime/Engine itself. (e.g. /Components/SplineMeshComponent.h)