Download

Disable DetourCrowds

Hey, I am using DetourCrowds to tell my character to avoid another characters.
In the AAICONTROLLER I have this code which enable DetourCrowds:



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


I have wondered is there a way to disable it?

Edit:
I have find out that I need to use UCrowdFollowingComponent::SetCrowdObstacleAvoidance(false). but how can I get a reference to the UCrowdFollowingComponent object?

Edit 2:
Problem solved:


UCrowdFollowingComponent* CrowdComp = Cast<UCrowdFollowingComponent>(PathFollowingComponent);