How do I move an NPC with CharacterController in C++?

I’ve created a simple NPC class in c++ and I want to move the character forward. I’ve tried

GetCharacterMovement()->AddForce(GetActorForwardVector() * WalkSpeed);

to no avail (it should also be noted that the documentation recommends against this). In Unity there was CharacterController.Move(Vector3) that I could call. Is there something similar in UE4 that I’m missing?

[EDIT] Figured this one out. Full answer is below.

You should try to update the Velocity of the character movement component

Figured this one out on my own. My animation was using root motion, but I hadn’t set up the blueprint properly. However, I did find the correct workaround which I’ll leave here in case someone needs it later:

// find out which way is forward
const FRotator Rotation = Controller->GetControlRotation();
const FRotator YawRotation(0, Rotation.Yaw, 0);
    		
// get forward vector
const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
    		
float Value = 1.f;
AddMovementInput(Direction, Value);

This code is from the third person character sample and works just as well for non-player characters. the Value field just has to be something normalized from [-1,1].