What is the C++ equivalent for the Blueprint node "AI MoveTo"?

I’m trying to make the AI Controller for my enemy character and right now I’m working on making the enemy AI to move the enemy towards the player’s character. If I was using Blueprint, the node that I would want to use is “AI MoveTo”, but I’m using C++. What is the equivalent (or closest) function in C++? My guess is “AAIController::MoveTo”, but I’m not sure.

I’m also trying to use as much C++ as possible and avoid using Blueprint. It’s just for fun and learning.

Here is an image for reference of the Blueprint that I’m trying to replicate in C++:

By the way, I’m doing the Twinstick Shooter tutorial, except I’m trying to do it all in C++.

Any help would be greatly appreciated! :slight_smile:

Correct, it is AAIController::MoveTo (AAIController::MoveTo | Unreal Engine Documentation)

Do you know how to add something like the 'On Success" output on that node in c++? I can’t seem to find out how to make the AI wait for the move command to stop.

You could have a temporary boolean variable that is switched to true when the MoveTo function is finished or the AI overlaps with the actor. Then in Tick, it checks to see if your boolean is true or not. Just an idea, I’m not sure if it will actually work.