Can I use Unreal's navigation system such that my AI always moves in the direction it is facing?

I’m trying to use Unreal’s navigation system to move my AI within a navigation volume. My AI is derived from AIController and I’ve looked at all the options in the CharacterMovement component. As far as I can see there are only a few ways to make the AI move using Unreal’s navigation system: The “Simple Move To Location” node, the “Simple Move To Actor” node, the “Move To Location or Actor” node, and the “MoveTo” tasks in behavior trees.
The default behavior of these is not what I’m looking for.

I see the option “Orient Rotation to Movement” in the Character Movement component, which doesn’t really do what I want. With this option, the character movement code moves (X,Y,Z) the character towards the goal, regardless of the orientation, and then tries to orient the character to face that direction of movement. I want the opposite approach. The character should move in the direction it is facing, and the character movement code should change the orientation to head towards the goal. Does this exist?

The default approach looks OK if you have the Rotation Rate (in the Character Movement General Settings category) set very fast, but if you have a big slow character (that should turn slowly) the default approach look terrible.

As you can see in this example, because I have the Rotation Rate set low (100), the AI ends up not moving in the direction he is facing for a big chunk of the nav path. In the comments below you can see the simple blueprint that creates this behavior.

Can you post a screenshot of the blueprint you’re using to control the movement?

Nothing special there. It’s from a tutorial really. Just ping pong it between two locations by hitting ‘F’ and ‘G’.

You’ll probably want to use AddActorLocalOffset to move the player forward and then AddActorLocalRotation to turn the player. Of course, you’ll need to add some logic to move/turn smoothly over time, as well.

I’m trying to use the CharacterMovement component within a Navigation volume. If I can avoid it, I rather not write my own character navigation system. I just want to know if the one that comes with Unreal can be made to do what I want.

Gotcha. So, you’re gonna want to call AddMovementInput on the character. For the direction vector, you’re going to want to call GetForwardVector on the character That’ll move the character forward.

Then, to turn, call AddControllerPitch/Yaw/Roll functions on the character.

Well you’re still describing me manually navigating the character myself rather than using Unreal’s integrated navigation system. I appreciate you trying to help but that’s not what I’m looking for. I’ll rephrase the question again to clarify.

The best I’ve been able to figure out is to derive from AIController and override UpdateControlRotation to both steer and move the character “forward” using the movement speeds from the character movement component, copied locally and zeroing out the regular ones so that the other parts of the navigation system don’t also try to move the character. I use an InterpTo function to get the current orientation to head towards AAIController::GetFocalPoint().

What this gets me is an AI that only moves forward and rotates to steer, but as far as the Unreal engine goes, behaves normally, with path finding and navigation working as normal. All blueprint and behavior tree nodes and tasks work normally without modification or setup (The “Simple Move To Location” node, the “Simple Move To Actor” node, the “Move To Location or Actor” node, and the “MoveTo” tasks in behavior trees).

I have same problem and I don’t understand what function need override. I use SimpleMoveToLocation for moving My Character. Function UpdateControlRotation I think don’t need override, ai rotate well. But I need override move component and don’t know how. Can you explain me what are you done for get solution?

You probably want to be setting the focus on the AI controller.

This not relevant for me. I want use navigation for AI.