# Detour Crowd does crash after adding a new bot in editor

**URL:** <https://forums.unrealengine.com/t/detour-crowd-does-crash-after-adding-a-new-bot-in-editor/472596>\
**Category:** Getting Started & Setup\
**Tags:** detour-crowds, detour-crowd-ai-cont, unreal-engine, crash, question\
**Created:** [October 9, 2020, 10:22am UTC](https://forums.unrealengine.com/t/detour-crowd-does-crash-after-adding-a-new-bot-in-editor/472596 "2020-10-09T10:22:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haeschdel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Haeschdel](https://forums.unrealengine.com/u/Haeschdel)\
**Post date:** [October 9, 2020, 10:22am UTC](https://forums.unrealengine.com/t/detour-crowd-does-crash-after-adding-a-new-bot-in-editor/472596/1 "2020-10-09T10:22:49Z")

</div>

Hi there.

I have a problem with the detour crowd system. Some time ago i had the problem that on simulate/play the game in editor, the editor crashes randomly while playing when using detour crowd. The error message was missing interface implementation or something. i could fix this by registering the crowd agents in the constructor of the my base character class (bots and player-characters are children of that class) and it works just fine until i upgrade from ue4.21.2 to 4.25.3.

Now, when i am adding a new bot (drag and drop new blueprint from my bot class) to a level and start game/simulate in editor it crashes instandly with a new error message, se below:

```
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000008

UE4Editor_AIModule!UCrowdManager::UpdateSelectedDebug() [D:\Build\++UE4+Licensee\Sync\Engine\Source\Runtime\AIModule\Private\Navigation\CrowdManager.cpp:872]
UE4Editor_AIModule!UCrowdManager::DebugTick() [D:\Build\++UE4+Licensee\Sync\Engine\Source\Runtime\AIModule\Private\Navigation\CrowdManager.cpp:1118]
UE4Editor_Engine!FTickableGameObject::TickObjects() [D:\Build\++UE4+Licensee\Sync\Engine\Source\Runtime\Engine\Private\Tickable.cpp:151]
UE4Editor_UnrealEd!UEditorEngine::Tick() [D:\Build\++UE4+Licensee\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1725]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [D:\Build\++UE4+Licensee\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:414]
UE4Editor!FEngineLoop::Tick() [D:\Build\++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4850]
UE4Editor!GuardedMain() [D:\Build\++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:169]
UE4Editor!GuardedMainWrapper() [D:\Build\++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137]
UE4Editor!WinMain() [D:\Build\++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:268]
UE4Editor!__scrt_common_main_seh() [d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

```

When i am adding a bot, save and restart the editor it works as expected without a crash. It still looks like that something is not working correctly with agent registration but i can’t find out why.

Like in the description of the detour crowd system by epic i addet the crowd interface to the character class, implement the interface functions like GetCrowdAgentLocation(), GetCrowdAgentVelocity()… in the character class, registering those actors with

```
UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(this);
	if (CrowdManager)
	{
		ICrowdAgentInterface* MyAgent = Cast<ICrowdAgentInterface>(this);
		CrowdManager->RegisterAgent(MyAgent);
	}

```

in the constructor of the character class and change the constructor of my ai controller to

```
AUE4_AIController::AUE4_AIController(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.SetDefaultSubobjectClass<UCrowdFollowingComponent>(TEXT("PathFollowingComponent")))

```

Do i miss something else?

Some more informations:  
I testet this on multiple levels, all with the same result.  
Unregistering bots/agents by deleting a bot in editor or killing the bot ingame does work without any problems.  
I have also tested this with different meshes, humanoids including the original epic mannequin mesh, other humanoid characters and also no humanoid to check if there may be a problem with the mesh/collision/rig itself, but allways the same result.

maybe somebody else has an idea whats going on. thank you very much!

---

<div class="post-metadata">

**Author:** ![Haeschdel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Haeschdel](https://forums.unrealengine.com/u/Haeschdel)\
**Post date:** [October 9, 2020, 10:23am UTC](https://forums.unrealengine.com/t/detour-crowd-does-crash-after-adding-a-new-bot-in-editor/472596/2 "2020-10-09T10:23:37Z")

</div>

Oh by the way. Now i addet a bot, klicked on save level and the editor crashed instantly on the saving process with this message.

Unhandled Exception: EXCEPTION\_ACCESS\_VIOLATION 0x00000000

UE4Editor\_AIModule!UCrowdManager::PrepareAgentStep() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\AIModule\Private\Navigation\CrowdManager.cpp:762]  
UE4Editor\_AIModule!UCrowdManager::Tick() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\AIModule\Private\Navigation\CrowdManager.cpp:237]  
UE4Editor\_NavigationSystem!UNavigationSystemV1::Tick() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\NavigationSystem\Private\NavigationSystem.cpp:998]  
UE4Editor\_Engine!UWorld::Tick() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1492]  
UE4Editor\_UnrealEd!UEditorEngine::Tick() [D:\Build++UE4+Licensee\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1515]  
UE4Editor\_UnrealEd!UUnrealEdEngine::Tick() [D:\Build++UE4+Licensee\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:414]  
UE4Editor!FEngineLoop::Tick() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4850]  
UE4Editor!GuardedMain() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:169]  
UE4Editor!GuardedMainWrapper() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137]  
UE4Editor!WinMain() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:268]  
UE4Editor!\_\_scrt\_common\_main\_seh() [d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe\_common.inl:288]  
kernel32  
ntdll

Should i register the agent in the begin play function of my character class instead of the constructor?  
Seems like that something is messed up.

---

<div class="post-metadata">

**Author:** ![Myshj](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Myshj](https://forums.unrealengine.com/u/Myshj)\
**Post date:** [February 28, 2026, 10:13am UTC](https://forums.unrealengine.com/t/detour-crowd-does-crash-after-adding-a-new-bot-in-editor/472596/3 "2026-02-28T10:13:59Z")

</div>

Sorry for necroposting. However, I’ve just encountered this very behavior after implementing my save-load system and have a solution. The solution is in fact very simple.

As a background. I have a component declared like this:

```cpp
class PROJECTEGYPT_API UPlayerCrowdHelper : public UActorComponent, public ICrowdAgentInterface

```

And then doing a call on begin play:

```cpp
void UPlayerCrowdHelper::BeginPlay()
{
	Super::BeginPlay();

	if (const auto CrowdManager = UCrowdManager::GetCurrent(this))
		CrowdManager->RegisterAgent(this);
}

```

The only thing missing was just **unregistering** the component:

```cpp
void UPlayerCrowdHelper::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
	Super::EndPlay(EndPlayReason);
	
	if (const auto CrowdManager = UCrowdManager::GetCurrent(this))
		CrowdManager->UnregisterAgent(this);
}

```

Done that, no more random crashes after destroying and possibly recreating a pawn. Hope the solution helps somebody in the future.
