i have an object that creates tiles using static mesh components.
The generation code is as follows:
UStaticMeshComponent* tile = NewObject<UStaticMeshComponent>(this, componentName);
if (tile != nullptr) {
tile->SetSimulatePhysics(false);
tile->SetupAttachment(RootComponent);
tile->SetStaticMesh(meshToSpawn);
tile->SetRelativeLocation(spawnOffset);
}
else {
UE_LOG(LogTemp, Error, TEXT("StaticMeshMapGenerator failed to create tile component at coords %dx%d !"), rowIndex, colIndex);
}
this seems to correctly generate a component for each tile, but the mesh doesn’t seem to be visible…
each component would seem to have a correct location ,mesh and material (see screenshot), but nothing appears on screen.
What am i missing?