[Crash] Template Mismatch during attachment

Issue:

When stopping PIE, a breakpoint is hit for every Star_Base (custom BP class) Actor spawned.

##Details:
Re-parenting to ‘Actor’ and back to it’s actual parent (without saving in between) ‘fixes’ the problem until the editor is launched again.

I have also found that if the class is not referenced in another specific class, there is no crashing, but as soon as I add the reference back and restart the editor (even if the functions are not called), the problem re-appears.

#error message:

“Template Mismatch during attachment. Attaching template component to instanced component. Parent ‘SceneBase’ Self ‘Camera’.”

This is found in SceneComponent.cpp in AttachTo (called from OnComponentDestroyed)

Note: This also happens in 4.9 Version: 4.9.0-2633546+++depot+UE4-Releases+4.9

##Relevant log output:

LogOutputDevice: === Handled error: ===
Ensure condition failed: false [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.8\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 1153]
Template Mismatch during attachment. Attaching template component to instanced component. Parent 'DefaultSceneRoot' Self 'CameraBoom'
Stack: 
UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump() {0x000007fed65eac36} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FDebug::EnsureFailed() {0x000007fed6484411} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FDebug::EnsureNotFalse_OptionallyLogFormattedEnsureMessageReturningFalse() {0x000007fed64846c3} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Engine.dll!USceneComponent::AttachTo() {0x000007fecfa23b94} + 122 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Engine.dll!USceneComponent::OnComponentDestroyed() {0x000007fecfa52474} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Engine.dll!UActorComponent::BeginDestroy() {0x000007fecf947608} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-CoreUObject.dll!UObject::ConditionalBeginDestroy() {0x000007fed70f9264} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-CoreUObject.dll!CollectGarbageInternal() {0x000007fed70f8bf8} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-CoreUObject.dll!CollectGarbage() {0x000007fed70f8315} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-UnrealEd.dll!UEditorEngine::EndPlayMap() {0x000007fed2aa47a6} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-UnrealEd.dll!UEditorEngine::Tick() {0x000007fed28a7f16} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick() {0x000007fed2d687d6} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor.exe!FEngineLoop::Tick() {0x000000013f6442d1} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor.exe!GuardedMain() {0x000000013f6349cc} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor.exe!GuardedMainWrapper() {0x000000013f634a4a} + 5 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor.exe!WinMain() {0x000000013f6465c9} + 17 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor.exe!__tmainCRTStartup() {0x000000013f6475d9} + 21 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
1 Like

I managed to find the file that actor that was causing this issue and fixed it by creating a new version of it from scratch (copy/pasting functions and components from the original).

Duplicating the actor class didn’t work, but creating it from ‘scratch’ worked.

##Resolved - Solution:
Re-created the corrupted class