# UE 5.6 Crash when opening scene containing Actors with MassAgentComponent

**URL:** <https://forums.unrealengine.com/t/ue-5-6-crash-when-opening-scene-containing-actors-with-massagentcomponent/2589305>\
**Category:** Blueprint\
**Tags:** crash-editor, unreal-engine, CPP\
**Created:** [July 3, 2025, 4:28pm UTC](https://forums.unrealengine.com/t/ue-5-6-crash-when-opening-scene-containing-actors-with-massagentcomponent/2589305 "2025-07-03T16:28:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FloppyLolo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/floppylolo/32/601143_2.png) [@FloppyLolo](https://forums.unrealengine.com/u/FloppyLolo)\
**Post date:** [July 3, 2025, 4:28pm UTC](https://forums.unrealengine.com/t/ue-5-6-crash-when-opening-scene-containing-actors-with-massagentcomponent/2589305/1 "2025-07-03T16:28:31Z")

</div>

I just upgraded to 5.6 today and I’m experiencing a crash when opening scenes that contains Actors with MassAgentComponent.

As soon as scene opens the engine crashes with this callstack:

```auto
|>|[Inline Frame] UnrealEditor-MassEntity.dll!TMapBase<UScriptStruct const *,int,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<UScriptStruct const *,int,0>>::FindChecked(const UScriptStruct *) Line 729|C++|
|---|---|---|
| |UnrealEditor-MassEntity.dll!FMassArchetypeData::SetFragmentData(TArrayView<FMassArchetypeEntityCollection::FArchetypeEntityRange const ,int> EntityRangeContainer, const FInstancedStruct & FragmentSource) Line 447|C++|
| |UnrealEditor-MassEntity.dll!FMassEntityManager::BatchSetEntityFragmentValues(TArrayView<FMassArchetypeEntityCollection const ,int> EntityCollections, TArrayView<FInstancedStruct const ,int> FragmentInstanceList) Line 1780|C++|
| |UnrealEditor-MassSpawner.dll!UMassSpawnerSubsystem::DoSpawning(const FMassEntityTemplate & EntityTemplate, const int NumToSpawn, FConstStructView SpawnData, TSubclassOf<UMassProcessor> InitializerClass, TArray<FMassEntityHandle,TSizedDefaultAllocator<32>> & OutEntities) Line 139|C++|
| |UnrealEditor-MassSpawner.dll!UMassSpawnerSubsystem::SpawnEntities(const FMassEntityTemplate & EntityTemplate, const unsigned int NumberToSpawn, TArray<FMassEntityHandle,TSizedDefaultAllocator<32>> & OutEntities) Line 63|C++|
| |UnrealEditor-MassActors.dll!UMassAgentSubsystem::HandlePendingInitialization() Line 328|C++|

```

Same happens with a dev build with the same callstack

```auto
FDebug::CheckVerifyFailedImpl2()
FMassArchetypeData::SetFragmentData()
!FMassEntityManager::BatchSetEntityFragmentValues()
UMassSpawnerSubsystem::DoSpawning()
UMassSpawnerSubsystem::SpawnEntities()
UMassAgentSubsystem::HandlePendingInitialization()
TBaseUObjectMethodDelegateInstance<0,UMassAgentSubsystem,void __cdecl(float),FDefaultDelegateUserPolicy,enum EMassProcessingPhase>::ExecuteIfSafe()
IslesOfKrom!TMulticastDelegate<void __cdecl(float),FDefaultDelegateUserPolicy>::Broadcast()

```

From what I understand there seems to be discrepancy between the archetype and the data passed since it crashes when trying to find an absent fragment in the archetype.

I have no idea how I can fix this issue and I would gladly welcome some help in order to fix this issue.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![FloppyLolo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/floppylolo/32/601143_2.png) [@FloppyLolo](https://forums.unrealengine.com/u/FloppyLolo)\
**Post date:** [July 4, 2025, 2:46pm UTC](https://forums.unrealengine.com/t/ue-5-6-crash-when-opening-scene-containing-actors-with-massagentcomponent/2589305/2 "2025-07-04T14:46:09Z")

</div>

I manage to reproduce the issue in an empty project. Using only 2 actors that have each one specific traits. The traits are very simple and look like the code below:  
Simply having one bp with a massAgentComponent and an EC config sporting the first trait and a second Bp with also a massAgentComponent and a second EC Config sporting the secont trait is enough to crash the engine when the scene opens.

```auto
USTRUCT()
struct FFragment1 : public FMassFragment
{
	GENERATED_BODY()

	UPROPERTY()
	int32 Counter;
};

USTRUCT()
struct FFragment2 : public FMassFragment
{
	GENERATED_BODY()

	UPROPERTY()
	int32 Counter;

	UPROPERTY()
	FName Name;
};

USTRUCT()
struct FFragment3 : public FMassFragment
{
	GENERATED_BODY()

	UPROPERTY()
	int32 Counter;

	UPROPERTY()
	float Perc;
};

USTRUCT()
struct FTag1 : public FMassTag
{
	GENERATED_BODY()
};

UCLASS()
class MYPROJECT2_API UTraits1 : public UMassEntityTraitBase
{
	GENERATED_BODY()

public:

	virtual void BuildTemplate(FMassEntityTemplateBuildContext& BuildContext, const UWorld& World) const override;
};

UCLASS()
class MYPROJECT2_API UTraits2 : public UMassEntityTraitBase
{
	GENERATED_BODY()

public:

	virtual void BuildTemplate(FMassEntityTemplateBuildContext& BuildContext, const UWorld& World) const override;
};

void UTraits1::BuildTemplate(FMassEntityTemplateBuildContext& BuildContext, const UWorld& World) const
{
	FFragment1 Fragment1;
	Fragment1.Counter = 0;
	BuildContext.AddFragment(FConstStructView::Make(Fragment1));

	FFragment2 Fragment2;
	Fragment2.Counter = 0;
	Fragment2.Name = FName{TEXT("Traits1")};
	BuildContext.AddFragment(FConstStructView::Make(Fragment2));
}

void UTraits2::BuildTemplate(FMassEntityTemplateBuildContext& BuildContext, const UWorld& World) const
{
	BuildContext.RequireFragment<FMassActorFragment>();
	BuildContext.AddTag<FTag1>();

	FFragment2 Fragment3;
	BuildContext.AddFragment(FConstStructView::Make(Fragment3));
}

```

---

<div class="post-metadata">

**Author:** ![James.Keeling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@James.Keeling](https://forums.unrealengine.com/u/James.Keeling)\
**Post date:** [August 22, 2025, 1:06pm UTC](https://forums.unrealengine.com/t/ue-5-6-crash-when-opening-scene-containing-actors-with-massagentcomponent/2589305/3 "2025-08-22T13:06:38Z")

</div>

Hey!

This is indeed a bug. We have a fix in review currently, but it will not be available in a launcher build until 5.7. Once the fix is committed, it will be on our public UE5 GitHub main branch. I can send a link to the GitHub commit once it has mirrored over if you build from source.

-James

---

<div class="post-metadata">

**Author:** ![FloppyLolo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/floppylolo/32/601143_2.png) [@FloppyLolo](https://forums.unrealengine.com/u/FloppyLolo)\
**Post date:** [August 22, 2025, 6:03pm UTC](https://forums.unrealengine.com/t/ue-5-6-crash-when-opening-scene-containing-actors-with-massagentcomponent/2589305/4 "2025-08-22T18:03:08Z")

</div>

Hello James,

Thanks a lot for the follow up on this.  
and yes, I would be really interested in having the github link when it is available.

Cheers,  
Lolo.

---

<div class="post-metadata">

**Author:** ![James.Keeling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@James.Keeling](https://forums.unrealengine.com/u/James.Keeling)\
**Post date:** [August 25, 2025, 12:15pm UTC](https://forums.unrealengine.com/t/ue-5-6-crash-when-opening-scene-containing-actors-with-massagentcomponent/2589305/5 "2025-08-25T12:15:50Z")

</div>

This has been committed. Here is a link to the commit on our public GitHub: [https://github.com/EpicGames/UnrealEngine/commit/39120795f693bcdbb59f72e5ef640a3b46ed2b3c](https://github.com/EpicGames/UnrealEngine/commit/39120795f693bcdbb59f72e5ef640a3b46ed2b3c)

I believe this should cover the crash you have been seeing.

-James
