AI snapping/jerking when following

I know this question has been asked many, many times and I’ve spent the last two hours searching for an answer that might actually help, so far nothing has worked.

I understand the basic “fix” for this, ie this thread: How to achieve smooth rotation using Navmesh? (actor keeps snapping towards direction) - World Creation - Unreal Engine Forums

Uncheck “Use Controller Rotation Yaw”, check “Orient rotation to movement” and then set yaw to “something you like”.

The problem I have is that even the slightest move in any direction when the AI is following me will cause it to snap back and forth as it realigns itself. Since the angle of rotation is so small, I would have to set the yaw to 1-2 degrees which basically makes the AI unable to turn at all (and even then the rotation isn’t smooth if it is far enough away so the angle is very small).

Does anyone have any idea how to fix this? Any way to forcibly prevent this snapping motion? Since my AI has a large weapon that sticks out behind him the snapping motion becomes painfully obvious and as I said, none of the solutions I have found have had any noticeable effect. I thought maybe it was a weapon collision problem (the weapon is a static mesh attach to a socket on the AI), but that didn’t seem to fix anything at all. Also tried the “Can ever affect navigation” node with no luck.

Any ideas would be greatly appreciated.

Just adding that this is definitely not an animation problem as I have tested with turning off animations and simply having him in his bind pose, he still snaps around like mad when realigning. If there was any way to smooth this that would be great.

I’ve tried importing the animation in various frames per second now, from 30 to 100. And it helps a little visually, but the AI is still doing that extreme snapping as he realigns.

Still hoping anyone has ideas.

is it a animation from mixamo cause i would check the>> in place << i had the same issue and was able to fix it that way

No, I’ve made the character and the animation. There is no problem with the animation itself because I’ve checked with disabling his animation and having him just follow me in his bind pose. He still snaps.

Tested this with the UE Mannequin as well and the animation BP that comes with the engine. Gives the same problem. Here’s the simple code for having it follow me:

A video would help but are you checking the target location value you are using for move to? It may be changing constantly and preventing the pawn from moving towards a single direction.

Edit: Nvm, the page hadnt updated before i posted, just saw the screenshot. So instead of a delay loop like that try firing it with event tick instead and see if it changes the behavior.

when you say snapping motion are you referring to a forward back movement or rotation? it sounds like rotation but some people are talking about animations and such.

if its a rotation issue have you tried changing the rotation rate in the character movement component? that would enable you to slow down how quickly the character rotates.

As I wrote in the opening post, changing the rotation will have no effect unless you set it to less than 5 degrees, which essentially means the AI will be unable to rotate at all. It’s not a rotation issue. I’ve illustrated this in the following picture:

And I’ll attach a video of a scaled up UE Mannequin following me so you can see what’s happening (using a behavior tree AI to move it now, same as when using a simple MoveTo blueprint):

Adding another video as the AI’s very large weapon makes it even more obvious what is happening:

You are immediately calling Seek Player after .2 second delay on a continual loop. Disconnect the top output for AIMoveTo

That’s irrelevant. I’ve tried changing that to 0,5, 1 etc, makes no difference. And in the video it is controlled via behavior tree with 0,5 sec ticks.