# Missing DetourCrowdAIController in C++

**URL:** <https://forums.unrealengine.com/t/missing-detourcrowdaicontroller-in-c/474481>\
**Category:** C++\
**Tags:** aicontroller, detour-crowd-ai-cont, unreal-engine, question, CPP\
**Created:** [November 14, 2020, 9:26pm UTC](https://forums.unrealengine.com/t/missing-detourcrowdaicontroller-in-c/474481 "2020-11-14T21:26:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SASCommando](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SASCommando](https://forums.unrealengine.com/u/SASCommando)\
**Post date:** [November 14, 2020, 9:26pm UTC](https://forums.unrealengine.com/t/missing-detourcrowdaicontroller-in-c/474481/1 "2020-11-14T21:26:02Z")

</div>

I am trying to create an AI Controller in C++ but I want to inherit from DetourCrowd instead of the standard AIController.

When I look for DetourCrowdAIController out of all classes in the Unreal Editor only AIController shows up. This one is not an option. (“AIModule” has already been added as a dependency.)

 ![322044-missing-detourcrowdaicontroller.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/c/90cfff5a8f18f8fd9cc3356191de9cafb42758d0.png)

- Any idea why this could be?

As such, I created a class deriving from standard AIController and tried to reparent it from “AAIController” to “ADetourCrowdAIController” but this throws compiler errors.

 ![322045-detourcrowdaicontroller-reparent-compile-errors.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/d/7/dd70cf682fa55be60dfdf48caa75cc390750647e.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7f67207c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7f67207c](https://forums.unrealengine.com/u/anonymous_user_7f67207c)\
**Post date:** [June 22, 2021, 12:56pm UTC](https://forums.unrealengine.com/t/missing-detourcrowdaicontroller-in-c/474481/2 "2021-06-22T12:56:27Z")

</div>

did you find solution for this? I am having same problem.

---

<div class="post-metadata">

**Author:** ![chrudimer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrudimer/32/918651_2.png) [@chrudimer](https://forums.unrealengine.com/u/chrudimer)\
**Post date:** [June 22, 2021, 1:23pm UTC](https://forums.unrealengine.com/t/missing-detourcrowdaicontroller-in-c/474481/3 "2021-06-22T13:23:50Z")

</div>

Hi, in C++ you set it to use the UCrowdFollowingComponent instead of only the PathFollowingComponent. So in the constructor of your AI controller you do this

```
ABaseAIControllerCPP::ABaseAIControllerCPP(const FObjectInitializer& ObjectInitializer)

	: Super(ObjectInitializer.SetDefaultSubobjectClass<UCrowdFollowingComponent>(TEXT("PathFollowingComponent"))) {

}

```

and ofc replace ABaseAIControllerCPP with your own.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_888b9c60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_888b9c60](https://forums.unrealengine.com/u/anonymous_user_888b9c60)\
**Post date:** [July 24, 2022, 6:43pm UTC](https://forums.unrealengine.com/t/missing-detourcrowdaicontroller-in-c/474481/4 "2022-07-24T18:43:55Z")

</div>

EDIT: Solved, see my post below this one.

The function signature for the constructor is implemented as:

```auto
#include "GruxAIController.h"
#include "GruxAICharacter.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "GoalTarget.h"
#include "Kismet/GameplayStatics.h"
#include "Navigation/CrowdFollowingComponent.h"

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

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_888b9c60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_888b9c60](https://forums.unrealengine.com/u/anonymous_user_888b9c60)\
**Post date:** [July 25, 2022, 4:09pm UTC](https://forums.unrealengine.com/t/missing-detourcrowdaicontroller-in-c/474481/5 "2022-07-25T16:09:56Z")

</div>

Ah, just having the AI Controller use the `UCrowdFollowingComponent`, instead of the default Path Following Component, seems to work. So your answer solves the problem (without having to reparent one’s custom AI Controller class)\*, I thank you 🙂.

---

<div class="post-metadata">

**Author:** ![eblade](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eblade](https://forums.unrealengine.com/u/eblade)\
**Post date:** [July 25, 2022, 5:18pm UTC](https://forums.unrealengine.com/t/missing-detourcrowdaicontroller-in-c/474481/6 "2022-07-25T17:18:57Z")

</div>

while there does seem to be a class by that name, there’s no particularly good reason why it wouldn’t show up in editor that I can see, unless you just totally don’t have the AIModule.

All it is is a regular AIController with the CrowdFollowingComponent as default instead of PathFollowingComponent though, as above.
