Hey there!
I’ve been searching for two days through the couple of tutorials there are for Procedural Meshes - the closest I got was a couple of recommendations for RuntimeMeshComponent, which unfortunately doesn’t work with UE5 (I almost got it to compile, but TesselatedRendering seems to be gone in UE5)
Anyways, here’s my issue:
I have a pretty barebones Actor with a single ProceduralMeshComponent (initialized and attached in constructor). On initialization, it creates a simple GridMesh with UKismetProceduralMeshLibrary::CreateGridMeshWelded() and creates Section 0 of the PMC.
It has a BlueprintCallable function to destroy itself and spawn 4 smaller actors of itself (I’m building a quadtree LOD system)
This - the initial constructor and the splitting function - work fine in the editor.
Any actors spawned at runtime however show up in the world outliner but don’t render.
I’ve tried setting visibility, updating the mesh section, re-registering the component, nothing works. Maybe I need to recreate the Scene Proxy, but I couldn’t get that to work.
Here’s the relevant code:
constructor
{
ProcMeshComp = CreateDefaultSubobject<UProceduralMeshComponent>(TEXT("Procedural Mesh"));
RootComponent = ProcMeshComp;
}
InitMesh() {
UKismetProceduralMeshLibrary::CreateGridMeshWelded(...);
ProcMeshComp->UpdateMeshSection_LinearColor(...)
}
UFUNCTION(CallInEditor)
Split() {
ProcMeshComp->ClearAllMeshSections();
Destroy();
ATerrainChunk* Chunk1 = GetWorld()->SpawnActor<ATerrainChunk>();
Chunk1->InitMesh(...);
}
In Editor: Before Split → After Split
Runtime: After Split