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

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;
}

Recreation of blueprint helped me

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

1 Like