Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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: https://www.youtube.com/watch?v=VMOOQXfNKxE&feature=youtu.be

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

Moreover look at this: https://www.youtube.com/watch?v=tvYi5XEPXv0&feature=youtu.be 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?

Product Version: Not Selected
more ▼

asked May 09 '15 at 09:18 PM in C++ Programming

avatar image

82 9 17 27

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered May 13 '15 at 09:16 PM

avatar image

2.1k 83 37 121

avatar image Darkstorm1997 May 14 '15 at 05:53 PM

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) : 
avatar image kamrann May 14 '15 at 06:58 PM

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

 UCrowdFollowingComponent* CrowdFollowing = Cast< UCrowdFollowingComponent >(PathFollowingComponent);
 CrowdFollowing->CollisionQueryRange = ...;
avatar image Darkstorm1997 May 15 '15 at 08:01 AM

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

 UCrowdFollowingComponent* CFComponent = Cast< UCrowdFollowingComponent >(PathFollowingComponent);
avatar image kamrann May 15 '15 at 08:15 AM

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?

avatar image Darkstorm1997 May 15 '15 at 08:53 AM

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.

avatar image kamrann May 15 '15 at 08:57 AM

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.

avatar image Darkstorm1997 May 15 '15 at 09:56 AM

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

avatar image kamrann May 15 '15 at 10:01 AM

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.

avatar image Darkstorm1997 May 17 '15 at 07:26 PM

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

avatar image Rasponien Nov 11 '17 at 06:55 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question