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?
MieszkoZ
(MieszkoZ)
September 1, 2015, 6:05pm
2
Use UCrowdFollowingComponent::SetCrowdObstacleAvoidance(false)
.
Cheers,
–mieszko
Thank you for the answer, how can I get a reference to the UCrowdFollowingComponent object?
Your AI Controller will have a reference to the crowd following component. Check the PCIP in the constructor. I believe it’s usually listed as the “PathFollowingComponent”
MieszkoZ
(MieszkoZ)
September 1, 2015, 7:07pm
5
I strongly suggest you read source code you’re trying to use
You need to do this:
UCrowdFollowingComponent* CrowdComp = Cast<UCrowdFollowingComponent>(PathFollowingComponent);
while inside AI controller code.