Hi there,
For navmesh using AI pawns, I can’t seem to be able to get them to obey CharacterMovementComponent deceleration and breaking parameters. Movement obeys acceleration parameters (slowly speeds up), but comes to an abrupt stop at movement goal.
I’m using a move to location request on the owning ai controller.
I’ve tested with various combinations, with normal AIController class, DetourCrowdController class, with physical interactions on/off, with deceleration/breaking overrides on/off.
I’ve created a sample project that demonstrates the problem. It’s based off of TopDown sample.
To reproduce, open project, play in editor, and click on floor to issue move to request. Observe that AI obeys acceleration but not deceleration parameters.
Hi Abeccu,
From digging into code, I found that if you call SetStopMovementOnFinish(false) on the PathFollowingComponent, it will make the actor use acceleration to slow down, BUT, only after it has already reached it’s goal. So it will overshoot the goal.
I only partially tested this, so hopefully it will work for you.
I was able to simulate deceleration using a bit of math and adjusting the playing max walk speed as the player approached the target. I know this isn’t a true fix but it got the job done. I can dig up a screenshot if it’d be helpful.
In UE5.0 this seems to be broken when using the DetourCrowd AIController.
It works perfectly well with the default AIController but not with the detour one.
This is the solution that worked for me. Annoying that it’s a protected variable and can only edit in BP (as far as I can tell) but nice to have non-jittery AI movement finally. Many thanks!
yes, I just tried this and I can confirm that setting the CharacterMovementComponent property ‘Use Acceleration For Paths’ to true, and tweaking the braking decelration for walking/swimming etc. will make the characters decelrate closer to the end of a path… the lower the braking deceleration value, the earlier the character will start decelerating. If the value is high, the character will decelrate very quickly and stop abruptly, so be sure to play with this setting