Making a Character Move to where I clicked?

So, I am making a MOBA style character controller, were I would like my character to Pathfind to where I click by using a MoveTo node.

However, this is not working, and I suspect this is because I am using a player controller to control the character.
Is it possible to have both an AI controller required for the movement, but still have a Character controller to add inputs on abilities and such?

I imagine I could make a Camera as my player pawn, and the character is an AI that the camera casts commands to, but this seems like a very janky way to fix the problem.

Is there a better solution to this? Thanks.

As you probably already know, the built-in Top Down template shows one way to get around the AIController limitation, by relying on the AI Blueprint Helper Library’s Simple Move to Location node.

But if you are decided on using a “MoveTo” node (presumably along the lines of the Move to Location node), you will indeed have to possess your Character with an AI Controller of some kind. In this case, a “janky” solution like the one you outlined offers probably the most obvious approach, assuming one could learn to live with the slight weirdness of it.

As an unconventional third option, you could maybe do some C++ programming to expose the UPathFollowingComponent::RequestMove function (and probably other functions also) to Blueprint. By adding a Path Following Component to your Player Controller, you could call up your custom RequestMove node and, in doing so, instruct your possessed character to move using pathfinding. (This is actually how the built-in Simple Move To Location node/function handles this: by adding a UPathFollowingComponent to the controller, if it doesn’t already have one, and calling up the C++ RequestMove function linked above. So, seemingly, pathfinding magic can be gained almost anywhere by adding that component, so long as one isn’t too allergic to C++.)

Anyway, if it were up to me, I’d probably choose the “janky” path because it seems like it offers best bang for buck, with the least amount of effort to get good results. Plus, if I were ever planning on introducing heroes who control pets, this approach would easily adapt to that idea: the player’s hero uses an AI Controller, so why not just use another one for the pet? The only weird part is that there’s an invisible player pawn that’s permanently attached to the player’s AI-controlled hero pawn, and I think I could live with that. (But that’s just my opinion, I guess.)

Hopefully this helps you figure something out.

1 Like

Thank you for your detailed response. I think I will opt for the Camera Pawn Controlling the AI pawn. I’ve definitely done worse before, and since this project is only for showing off animations and SFX as opposed to being a full game, I will forgive myself for this solution, since you have assured me that there aren’t really any other straightforward options.
Thanks again.