# Error: Template Mismatch during attachment. Attaching instanced component to template component

**URL:** <https://forums.unrealengine.com/t/error-template-mismatch-during-attachment-attaching-instanced-component-to-template-component/426596>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 3, 2018, 6:42pm UTC](https://forums.unrealengine.com/t/error-template-mismatch-during-attachment-attaching-instanced-component-to-template-component/426596 "2018-06-03T18:42:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benui](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/benui/32/1145446_2.png) [@benui](https://forums.unrealengine.com/u/benui)\
**Post date:** [June 3, 2018, 6:42pm UTC](https://forums.unrealengine.com/t/error-template-mismatch-during-attachment-attaching-instanced-component-to-template-component/426596/1 "2018-06-03T18:42:41Z")

</div>

I’m getting this error with my custom actor.  
“Template Mismatch during attachment. Attaching instanced component to template component. Parent ‘CustomRootComp’ Self ‘CustomRootComp’”

This is what the constructor looks like. What am I doing wrong?

```
AMyThing::AMyThing( const FObjectInitializer& ObjectInitializer )
	: Super( ObjectInitializer )
{
	TranslationComp = ObjectInitializer.CreateDefaultSubobject<USceneComponent>( this, TEXT( "CustomRootComp" ) );
	TranslationComp->Mobility = EComponentMobility::Movable;
	RootComponent = TranslationComp;
}
```

---

<div class="post-metadata">

**Author:** ![dliubash](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dliubash](https://forums.unrealengine.com/u/dliubash)\
**Post date:** [December 7, 2020, 7:56pm UTC](https://forums.unrealengine.com/t/error-template-mismatch-during-attachment-attaching-instanced-component-to-template-component/426596/2 "2020-12-07T19:56:43Z")

</div>

Recreation of blueprint helped me

---

<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:30am UTC](https://forums.unrealengine.com/t/error-template-mismatch-during-attachment-attaching-instanced-component-to-template-component/426596/3 "2023-05-29T09:30:44Z")

</div>

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

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/2/612757fcbc1e09f57ddcf787f82483b5ec68e3d9.png)
