Quick answer: The most common cause is that the PCG component does not have the GenerateAtRuntime (or Generation Trigger set to GenerateAtRuntime) option enabled. By default, PCG components only generate during editor time and bake results into the level.

Here is how to fix Unreal pcg not generating runtime. You built a PCG graph that scatters beautiful foliage across your landscape, randomizes prop placement in a dungeon corridor, or generates a full procedural village — it looks fantastic in the editor viewport. But when you hit Play, the world is bare. No meshes spawn, no instances appear, and the PCG component sits idle as if the graph never existed. The Procedural Content Generation framework has a clear separation between editor-time and runtime execution, and without the right configuration, your carefully crafted graphs will never run during gameplay.

The Symptom

You have a UPCGComponent attached to an actor in your level, with a PCG graph assigned that generates static mesh instances, spline-based roads, or scattered actors. In the editor, clicking the Generate button on the component produces the expected results — meshes appear, instances are scattered across the landscape, and everything looks correct. But when you enter Play In Editor, all generated content vanishes and the world appears empty where PCG content should exist.

In another variant, the PCG-generated content is visible during PIE because it was baked during the editor session, but when you package the game and run the standalone build, certain areas are missing their procedural content entirely. This is especially common with World Partition levels where PCG partition actors handle the baked output across streaming cells.

A third scenario involves dynamically spawned actors that carry PCG components. You spawn an actor at runtime, the actor appears in the world, but the PCG component on it never executes its graph. No meshes are generated, no collision is created, and the actor is effectively an empty shell. Calling Generate() from Blueprint or C++ seems to do nothing, or it completes instantly without producing any output points.

What Causes This

1. GenerationTrigger is not set to a runtime mode. The UPCGComponent has a GenerationTrigger property that controls when the graph executes. The default value is GenerateOnLoad, which only runs during editor-time level loading and bakes the results. For runtime generation, you must set this to GenerateAtRuntime or GenerateOnDemand. Without this flag, the PCG subsystem skips the component entirely during gameplay.

2. PCG partition actors are not loaded or cooked. When using World Partition, PCG generates content into partition actors that live in specific grid cells. If those cells are not loaded by the streaming system at runtime, or if the partition actors were excluded from the cook, the baked PCG content will not appear. This is the primary reason PCG content works in the editor but disappears in packaged builds — the partition grid configuration must be compatible with the runtime streaming settings.

3. The PCG graph depends on editor-only data. Some PCG nodes sample data that only exists at editor time. Landscape spline data, certain Landscape layer weight samples, and editor-only actor references will return empty or null results at runtime. The graph executes but produces zero output points because its input data is missing, resulting in no visible generation.

4. The component is not registered or the actor is not in the world. For dynamically spawned actors, the PCG component must be fully registered with the world before generation can occur. If you call Generate() in the constructor or before the actor has been placed via SpawnActor, the PCG subsystem has no world context and silently fails. The component needs a valid world and transform before graph execution can produce meaningful spatial results.

The Fix

Step 1: Configure the PCG component for runtime generation and trigger it correctly. This sets up a PCG component that will generate procedural content when the game starts or when explicitly triggered during gameplay.

// ProceduralRoom.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "PCGComponent.h"
#include "PCGGraph.h"
#include "ProceduralRoom.generated.h"

UCLASS()
class AProceduralRoom : public AActor
{
    GENERATED_BODY()

public:
    AProceduralRoom();

    UPROPERTY(VisibleAnywhere, Category = "PCG")
    UPCGComponent* PCGComp;

    UPROPERTY(EditAnywhere, Category = "PCG")
    UPCGGraphInterface* RoomGraph;

    UPROPERTY(EditAnywhere, Category = "PCG")
    int32 Seed;

    UFUNCTION(BlueprintCallable)
    void RegenerateRoom();

protected:
    virtual void BeginPlay() override;
};

// ProceduralRoom.cpp
#include "ProceduralRoom.h"
#include "PCGSubsystem.h"

AProceduralRoom::AProceduralRoom()
{
    PrimaryActorTick.bCanEverTick = false;

    USceneComponent* Root = CreateDefaultSubobject<USceneComponent>(
        TEXT("Root"));
    RootComponent = Root;

    PCGComp = CreateDefaultSubobject<UPCGComponent>(
        TEXT("PCGComponent"));
    PCGComp->SetupAttachment(RootComponent);

    // Critical: set generation to happen at runtime
    PCGComp->GenerationTrigger = EPCGComponentGenerationTrigger::GenerateAtRuntime;

    // Assign the graph (can also be set in the editor)
    PCGComp->SetGraph(RoomGraph);

    Seed = 42;
}

void AProceduralRoom::BeginPlay()
{
    Super::BeginPlay();

    // Override the seed for variety across room instances
    PCGComp->Seed = Seed;

    // Ensure the graph is assigned if it was set via the editor
    if (RoomGraph && !PCGComp->GetGraph())
    {
        PCGComp->SetGraph(RoomGraph);
    }

    UE_LOG(LogTemp, Log,
        TEXT("PCG Room: Trigger=%d, Graph=%s, Seed=%d"),
        (int32)PCGComp->GenerationTrigger,
        PCGComp->GetGraph()
            ? *PCGComp->GetGraph()->GetName()
            : TEXT("None"),
        PCGComp->Seed);
}

Step 2: Manually trigger generation on a dynamically spawned actor and handle cleanup. When you spawn PCG actors at runtime from a dungeon generator or world builder, you need explicit control over when the graph runs and how to clean up previous results before regenerating.

// Spawn a procedural room actor and trigger its PCG graph
void ADungeonGenerator::SpawnRoom(FVector Location, int32 RoomSeed)
{
    FActorSpawnParameters SpawnParams;
    SpawnParams.SpawnCollisionHandlingOverride =
        ESpawnActorCollisionHandlingMethod::AlwaysSpawn;

    AProceduralRoom* Room = GetWorld()->SpawnActor<AProceduralRoom>(
        RoomClass, Location, FRotator::ZeroRotator, SpawnParams);

    if (!Room) return;

    // Set unique seed so each room looks different
    Room->Seed = RoomSeed;
    Room->PCGComp->Seed = RoomSeed;

    // For GenerateOnDemand mode, trigger generation explicitly
    if (Room->PCGComp->GenerationTrigger ==
        EPCGComponentGenerationTrigger::GenerateOnDemand)
    {
        Room->PCGComp->Generate();

        UE_LOG(LogTemp, Log,
            TEXT("Manual PCG generate for room at %s seed %d"),
            *Location.ToString(), RoomSeed);
    }

    SpawnedRooms.Add(Room);
}

// Regenerate a room with a new seed (e.g., for roguelike resets)
void AProceduralRoom::RegenerateRoom()
{
    if (!PCGComp) return;

    // Clean up the previously generated meshes and actors
    PCGComp->Cleanup();

    // Update the seed for new random variation
    Seed = FMath::Rand();
    PCGComp->Seed = Seed;

    // Re-execute the graph
    PCGComp->Generate();

    UE_LOG(LogTemp, Log,
        TEXT("Regenerated room with new seed: %d"), Seed);
}

Step 3: Diagnose PCG generation failures and fix partition actor issues. When generation appears to succeed but produces no visible output, these diagnostic techniques help identify whether the problem is in the graph data flow, the component configuration, or the World Partition streaming setup.

// Diagnostic: verify PCG subsystem state and component status
void ADungeonGenerator::DiagnosePCG(AProceduralRoom* Room)
{
    if (!Room || !Room->PCGComp) return;

    UPCGComponent* Comp = Room->PCGComp;

    // Check if the graph is assigned
    bool bHasGraph = Comp->GetGraph() != nullptr;

    // Check if generation was triggered
    bool bIsGenerated = Comp->IsGenerating() || Comp->bGenerated;

    // Check the generation trigger setting
    bool bIsRuntimeTrigger =
        Comp->GenerationTrigger ==
            EPCGComponentGenerationTrigger::GenerateAtRuntime ||
        Comp->GenerationTrigger ==
            EPCGComponentGenerationTrigger::GenerateOnDemand;

    UE_LOG(LogTemp, Warning,
        TEXT("PCG Diag: Graph=%s GenTrigger=%d IsGenerated=%s"),
        bHasGraph ? TEXT("Yes") : TEXT("NO GRAPH"),
        (int32)Comp->GenerationTrigger,
        bIsGenerated ? TEXT("Yes") : TEXT("No"));

    if (!bIsRuntimeTrigger)
    {
        UE_LOG(LogTemp, Error,
            TEXT("PCG component GenerationTrigger is NOT set to a "
            "runtime mode. Content will not generate during gameplay."));
    }

    // Check the PCG subsystem for registered components
    UPCGSubsystem* Subsystem =
        GetWorld()->GetSubsystem<UPCGSubsystem>();
    if (Subsystem)
    {
        UE_LOG(LogTemp, Log,
            TEXT("PCG Subsystem is active and available"));
    }
    else
    {
        UE_LOG(LogTemp, Error,
            TEXT("PCG Subsystem is NULL - PCG plugin may not be enabled"));
    }
}

// Fix: disable partition actors for runtime-generated content
// In your PCG component setup, disable partitioning to avoid
// World Partition conflicts with runtime generation:
//
// In the editor Details panel for UPCGComponent:
//   - Set "Is Partitioned" to false for runtime actors
//   - This avoids partition actor creation and streaming issues
//
// In C++:
Comp->bIsComponentPartitioned = false;

Related Issues

If your PCG graph generates meshes at runtime but the spawned static meshes have no collision, the issue is likely that the mesh assets are configured with complex collision that requires cooking. See our guide on overlap events not triggering for collision configuration guidance. If your PCG-generated actors need to be replicated in a multiplayer session, note that PCG runtime generation is client-side by default — see replicated variables not syncing for replication patterns.

PCG content shows in the editor but vanishes at runtime? Set GenerationTrigger to GenerateAtRuntime on the PCG component. The default only generates at editor time.