PathFollowingComponent bug?

My character has a reach point. I am using MoveToLocation (of AIController).
This character needs to avoid other characters, so I have created AIController and set the constructor to:

AVikingController::AVikingController(const FObjectInitializer& ObjectInitializer) : 

To connect the character and the new controller - on the constructor of the character:

AIControllerClass = AVikingController::StaticClass();
AutoPossessPlayer = EAutoReceiveInput::Disabled;
AutoPossessAI = EAutoPossessAI::PlacedInWorldOrSpawned;

And when I need to move the character:

AAIController* AIController = Cast<AAIController>(GetController());

if (AIController)
	AIController->MoveToLocation(pos, acceptanceRadius);

When I put 1 character in his way, he avoids it. But when I put 2 characters, well he avoids it but in a really weird way. I can not explain it so I have uploaded a video to describe it:

He wrap to the other characters and slows down instead of walking from the side and NOT slowing down.

Moreover look at this:

As you can see when the a static object blocks its way, the character always looks at the target point and not at the path direction.
This is not happans when I remove from the controller the UCrowdFollowingComponent.
Why is that happening? Is it a bug?

It looks like you may have RVO avoidance enabled, you should disable this if you are using UCrowdFollowingComponent. It’s a property of UCharacterMovementComponent, so in your character class, not controller class. Make sure that bUseRVOAvoidance is set to false.

If it already is disabled, or this doesn’t help, you may need to adjust the configuration settings of the crowd following. I haven’t played around with this yet, but there’s some info here.

As for your second issue, I don’t know but it looks like it may be a bug.

Ok, So I need yo edit CollisionQueryRange SeparationWeight and AvoidanceQuality to make this work. How can I edit those variables in code? I remind you that that UCrowdFollowingComponent sets with:

AVikingController::AVikingController(const FObjectInitializer& ObjectInitializer) : 

From within your AVikingController (probably the constructor or BeginPlay):

UCrowdFollowingComponent* CrowdFollowing = Cast< UCrowdFollowingComponent >(PathFollowingComponent);
CrowdFollowing->CollisionQueryRange = ...;

In what way did it not work? As I said I haven’t used crowd following so I have no idea if calling those methods with those values will give you the result you’re after. Or are you saying it crashed, or the values got overwritten?

I have tried to do this in the constructor but it did not work:

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

does not work in a way that it did not change anythinkg. It is not crashed I just do not see any results or any change in the character behavior. It does the same thing in the first video.

Okay in that case I don’t know I’m afraid. As a last attempt you could try moving the code to BeginPlay, just in case the UObject system is overwriting the values from a blueprint or something. And obviously you should try with different parameter values just in case.

Yeah I have tried with beginplay and different paramater’s values. Thank you for trying to help me :slight_smile:

No problem. I think with the full release of 4.8 there will be some documentation for this component, or at the very least some more community provided tutorials on using and configuring it. So probably worth just waiting a little while if it’s not super urgent.

Anyone? Not even UE’s developers ? It may be a bug.

I’m encountering a similar problem right now.

Whenever I do not set the default subobject class,

AMiniBossAIController::AMiniBossAIController(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.SetDefaultSubobjectClass<UJumpPathFollowingComponent>(TEXT("PathFollowingComponent")))

my character is able to move towards the destination, but when I do it, it can’t find the destination for some reason. Do I need to initialize the new class based component somehow, although I haven’t found anything on the internet about that.