# パッケージ化時にアタッチのエラーが発生する

**URL:** <https://forums.unrealengine.com/t/topic/1190427>\
**Category:** 日本語 (Japanese)\
**Tags:** Class, unreal-engine, packaging-projects, Components, Blueprint, question\
**Created:** [June 6, 2023, 7:51am UTC](https://forums.unrealengine.com/t/topic/1190427 "2023-06-06T07:51:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tutuhu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tutuhu](https://forums.unrealengine.com/u/tutuhu)\
**Post date:** [June 6, 2023, 7:51am UTC](https://forums.unrealengine.com/t/topic/1190427/1 "2023-06-06T07:51:57Z")

</div>

パッケージ化を行うとすると発生する、  
アタッチ関連のエラーの解消ができないため、質問させてください

パッケージ化を行うと下記のようなエラーが表示されます。

* * *

> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display:  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: begin: stack for UAT  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: === Handled ensure: ===  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error:  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: Ensure condition failed: false [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/Components/SceneComponent.cpp] [Line: 1897]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: Template Mismatch during attachment. Attaching instanced component to template component. Parent ‘CollisionCylinder’ (Owner ‘Default\_\_Enemy\_Parent\_ArcheType\_C’) Self ‘CharacterMesh0’ (Owner ‘Enemy\_Pickaxe\_2’).  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: Stack:  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe812ae4a3 UE4Editor-Engine.dll!\<lambda\_e1d97030b1c837ba9160ec12bb6e5b53\>::operator()() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp:1897]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7fd3f673 UE4Editor-Engine.dll!USceneComponent::AttachToComponent() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp:2132]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7fd5d376 UE4Editor-Engine.dll!USceneComponent::OnRegister() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp:674]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7fd0d0fe UE4Editor-Engine.dll!UPrimitiveComponent::OnRegister() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\PrimitiveComponent.cpp:606]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7fdc1312 UE4Editor-Engine.dll!USkinnedMeshComponent::OnRegister() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\SkinnedMeshComponent.cpp:491]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7fd5d6c3 UE4Editor-Engine.dll!USkeletalMeshComponent::OnRegister() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\SkeletalMeshComponent.cpp:531]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7fc53729 UE4Editor-Engine.dll!UActorComponent::ExecuteRegisterEvents() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp:1525]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7fc703f5 UE4Editor-Engine.dll!UActorComponent::RegisterComponentWithWorld() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp:1223]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7f89f5f2 UE4Editor-Engine.dll!AActor::IncrementalRegisterComponents() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:4619]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe801a06ef UE4Editor-Engine.dll!ULevel::IncrementalUpdateComponents() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp:1097]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe80c55b00 UE4Editor-Engine.dll!UWorld::UpdateWorldComponents() [D:\Build++UE4\Sync\Engine\Source\Runtime\Engine\Private\World.cpp:1970]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7e0c8e0b UE4Editor-UnrealEd.dll!UEditorEngine::InitializePhysicsSceneForSaveIfNecessary() [D:\Build++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:4447]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7e0e24af UE4Editor-UnrealEd.dll!UEditorEngine::Save() [D:\Build++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:4526]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7df90839 UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::SaveCookedPackage() [D:\Build++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\CookOnTheFlyServer.cpp:3506]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7df83fe4 UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::PumpSaves() [D:\Build++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\CookOnTheFlyServer.cpp:2347]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7df991df UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::TickCookOnTheSide() [D:\Build++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\CookOnTheFlyServer.cpp:1153]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7ddd5dfd UE4Editor-UnrealEd.dll!UCookCommandlet::CookByTheBook() [D:\Build++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\Commandlets\CookCommandlet.cpp:950]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffe7ddffc9a UE4Editor-UnrealEd.dll!UCookCommandlet::Main() [D:\Build++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\Commandlets\CookCommandlet.cpp:624]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff6fe769a29 UE4Editor-Cmd.exe!FEngineLoop::PreInitPostStartupScreen() [D:\Build++UE4\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:3369]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff6fe760eec UE4Editor-Cmd.exe!GuardedMain() [D:\Build++UE4\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:127]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff6fe76125a UE4Editor-Cmd.exe!GuardedMainWrapper() [D:\Build++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff6fe7752bd UE4Editor-Cmd.exe!WinMain() [D:\Build++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:268]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff6fe77736e UE4Editor-Cmd.exe!\_\_scrt\_common\_main\_seh() [d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe\_common.inl:288]  
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffec9cd7614 KERNEL32.DLL!UnknownFunction   
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffecb9a26a1 ntdll.dll!UnknownFunction   
> UATHelper: パッケージ化 (Windows (64-bit)): LogInit: Display: LogOutputDevice: Error: end: stack for UAT

* * *

原因を見る限り、  
親クラスの「Enemy\_Parent\_ArcheType\_C」の「CollisionCylinder」に子クラスの「Enemy\_Pickaxe\_2」がアタッチする時にエラーがでているようです。

クラスの関係は、エンジンの初期からある「Character」クラス→「Enemy\_Parent\_ArcheType\_C」（自作）→「Enemy\_Pickaxe」（自作）となっています。

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/9/29936783c68885973a65410871dd86c95a97eadb.png)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/5/5/855aa5f39de24aaff44f1731426142ad2121122a.png)

コンポーネントの方を確認してみると、  
「Enemy\_Pickaxe」の方は親からの継承したCapsule Componetが2重に表示されていました。  
恐らくこの時点で既に何かがおかしいと思うのですが、対策がわかりません。

何か原因の確認方法や解消方法をご存じの方がおられましたら、教えて頂ければと思います。

* * *

以下補足になります。

・親のコンポーネントは継承だけしている認識で  
ゲーム中に動的にBPでコンポーネントの追加や削除は行っておらず、  
親の変数とコンポーネントを使い回しているだけの状態です。  
（画像のArrow Debugのように子供にコンポーネントを新規追加することはあります。）

・「Enemy\_Pickaxe」と同様の「Enemy\_Parent\_ArcheType\_C」クラスの子クラスは10以上作成していますが、  
この「Enemy\_Pickaxe」のみ問題が発生しています。

・エディタウィンドウでのプレイや、スタンドアローンでは特に問題は発生していないのですが、  
パッケージ化時にはエラーが発生します。

・CharacterクラスのC++コードはデフォルトから変更していません。

・（継承）と表示されている2つの「Capsule Compornet」の「On Componet Hit」をクリックするとどちらも同じ  
イベントに飛びます。（内部的には同じデータの扱いになっている？）  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/4/4043a96f20a48559484ca6cccd9decbbb96140fe.png)

・親クラスにある「CharacterMesh0」にある末尾の「0」は昔はがなかった気がしますが、  
因果関係や表示されたタイミングなどは不明です。（データをかなり遡ってパッケージ化が問題なくできたときから表示されているようです。）

実行環境：  
Windows 10

作業環境：  
Unreal Engine 4.26.2

再現手順：5/5以上 100%発生

以上です。宜しくお願いします。
