# Template mismatch during attachment. Attaching instanced component to template component

**URL:** <https://forums.unrealengine.com/t/template-mismatch-during-attachment-attaching-instanced-component-to-template-component/641895>\
**Category:** C++\
**Tags:** Debugging, unreal-engine, Blueprint, question, CPP, UE4-27\
**Created:** [September 5, 2022, 1:05pm UTC](https://forums.unrealengine.com/t/template-mismatch-during-attachment-attaching-instanced-component-to-template-component/641895 "2022-09-05T13:05:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [September 5, 2022, 1:05pm UTC](https://forums.unrealengine.com/t/template-mismatch-during-attachment-attaching-instanced-component-to-template-component/641895/1 "2022-09-05T13:05:58Z")

</div>

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

In my .h file:

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

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

```

In my .cpp file constructor:

```auto
	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!

---

<div class="post-metadata">

**Author:** ![MIkasa1009](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mikasa1009/32/471575_2.png) [@MIkasa1009](https://forums.unrealengine.com/u/MIkasa1009)\
**Post date:** [May 29, 2023, 9:32am UTC](https://forums.unrealengine.com/t/template-mismatch-during-attachment-attaching-instanced-component-to-template-component/641895/2 "2023-05-29T09:32:05Z")

</div>

> [@Error: Template Mismatch during attachment. Attaching instanced component to template component](https://forums.unrealengine.com/t/error-template-mismatch-during-attachment-attaching-instanced-component-to-template-component/426596/3):
>
> I ran into the same problem because I changed the dependencies of the components in the C++ code. This was not a problem with the code, but because the UE4 engine did not properly reload all inherited blueprint classes. You can fix this by manually reloading the faulty blueprint classes

---

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [May 31, 2023, 7:38am UTC](https://forums.unrealengine.com/t/template-mismatch-during-attachment-attaching-instanced-component-to-template-component/641895/3 "2023-05-31T07:38:08Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Paul\_Bronowski](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Paul\_Bronowski](https://forums.unrealengine.com/u/Paul_Bronowski)\
**Post date:** [March 1, 2024, 5:34pm UTC](https://forums.unrealengine.com/t/template-mismatch-during-attachment-attaching-instanced-component-to-template-component/641895/4 "2024-03-01T17:34:03Z")

</div>

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)](https://forums.unrealengine.com/t/ue5-template-mismatch-during-attaching-of-instanced-component/1510733)

---

<div class="post-metadata">

**Author:** ![pdenton](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pdenton/32/911626_2.png) [@pdenton](https://forums.unrealengine.com/u/pdenton)\
**Post date:** [May 16, 2024, 9:04pm UTC](https://forums.unrealengine.com/t/template-mismatch-during-attachment-attaching-instanced-component-to-template-component/641895/5 "2024-05-16T21:04:54Z")

</div>

Hi, I had a similar issue in 5.4. Changing from BlueprintReadWrite to BlueprintReadOnly in UPROPERTY description of components created in the constructor fixed it. But before that I also refreshed the deriving BP by reparenting it to another class, reparenting it back and recompiling, so perhaps both actions were required, can’t say now.

---

<div class="post-metadata">

**Author:** ![zero.soul](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zero.soul/32/958024_2.png) [@zero.soul](https://forums.unrealengine.com/u/zero.soul)\
**Post date:** [September 15, 2024, 5:51pm UTC](https://forums.unrealengine.com/t/template-mismatch-during-attachment-attaching-instanced-component-to-template-component/641895/6 "2024-09-15T17:51:26Z")

</div>

not working for me, i am using 5.4

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [October 16, 2025, 8:07pm UTC](https://forums.unrealengine.com/t/template-mismatch-during-attachment-attaching-instanced-component-to-template-component/641895/7 "2025-10-16T20:07:58Z")

</div>

I explain the problem and suggest some solutions [here](https://forums.unrealengine.com/t/problems-spawning-sounds-attatched-to-a-component/2592331/3). Hope this helps others, as I spent days on issues from nested components and decided to figure out what was really going on.

Shoutout to @zero.soul for his proper long-term solution on initializing nested components.
