Template mismatch during attachment. Attaching instanced component to template component

Hi Everyone, it’s been a while since I’ve been trying to solve this issue.

In my .h file:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Room Components")
	USceneComponent *Scene_ProceduralComponents;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Room Components")
	UProceduralMeshComponent *ProceduralMesh_NorthDoor;

In my .cpp file constructor:

	ProceduralMesh_Floor = CreateDefaultSubobject<UProceduralMeshComponent>(TEXT("ProceduralMesh_Floor"));
	ProceduralMesh_Floor->SetupAttachment(Scene_ProceduralComponents);

	ProceduralMesh_NorthDoor = CreateDefaultSubobject<UProceduralMeshComponent>(TEXT("ProceduralMesh_North_Door"));
	ProceduralMesh_NorthDoor->SetupAttachment(Scene_ProceduralComponents);

The full Error:

Template Mismatch during attachment. Attaching instanced component to template component. Parent 'Scene_ProceduralComponents' (Owner 'Default__BP_ForestRoom_Spawn_C') Self 'ProceduralMesh_North_Door' (Owner 'BP_ForestRoom_Spawn_C_0').

I can clearly see that the problem is that the problem is that it’s trying to attach a component to the “Default__” class but I can’t really figure how to fix this.

This only happens the first time that I run the game with the debugger attached (Because it’s an Ensure and gets ignored after the first time), I see no problems in the generated dungeon but I think that I have to fix this.

I’ve read many threads about “Template mismatch during attachment” but none matched my case (I’ve also tried recreating the child blueprints from zero).

Thank you in advance!

1 Like

I wish this was the issue, I’ve already tried this so many times, but the warning is still there.
Thank you for your answer anyway!

Still an issue in UE5. I posted my workaround here: UE5 Template Mismatch During Attaching of Instanced Component - Development / Programming & Scripting - Epic Developer Community Forums (unrealengine.com)