Download

Using "AI Move To" with Character

Hello everyone :slight_smile:

I’ve been struggling at doing a proper movement system for an Action RPG prototype.

I’m currently using “Add Movement Input” to move my character (it’s a multiplayer prototype and so far as I know “simple move to location / actor” is not replicated so I can’t use it). And it’s far from giving a good game feel to the player. The character is bumping into enemies and is basically “dumb” in his movements.

My idea is to use the navmesh and “AI Move To” to move my character, is that doable ? If so do I have to use an AI Pawn for my player character? Because the Character base class does not seem to be able to move using it.

Thanks in advance for any answer :slight_smile:

Duplicate the MainBlueprint character for the template ur using…
remove the movement logic so its blank or as i did just disable the player input nodes

Add a navmesh bounds to the world and use P to show it as green or not
Use the blueprint below

http://blueprintue.com/blueprint/efybc_f3/

place that in the AIPlayer… and make sure its using AIController (details)
also add PAWN Sensing to the Left as a component
look at that in the Viewport of the AI and tweak to your liking

Should work when you run thru the vision arch in the pawn sensing options

Lemme know what template ur using and i can work better

First some thing i wasted like 2 days to discover: make sure you have navigation calculated for AI move. Hit “P” if it turns green its there.

I think I am doing setup you want:

  • i created “dummy” camera pawn that handles only camera zoom and rotation. And it snaps to location that i feed it with. I tried make it snap to some actor (referencd by pointer) but that is problem in multiplayer, it is easy to mess up all those pointers on servers and clients. Server side pointer will not work on client, so i found that setting location of where acter is on server side and replicating it is easier than finding location and pointer on server and on client.
  • then i have very simple “KeyboardAI” ai controller. I feed it with keyboard input values from PlayerController, then that KeyboardAI calculates direction vector it needs to move. I scale its length to 150-200 units, then add to current KeyboardAI pawn location and tell AI to move.
  • recently i started moving all that behavior into behavior tree.

It is also very easy to expand this into some squad movement, or switch from keyboard driven logic to some own behavior on the fly. Easy to add idle animations or idle behaviors (anim blueprint is quite limited for this).

I sadly cannot share my blueprints because it is full of market modules. I look into backups maybe i have one unspoiled.

I think we misunderstood each other (or at least I havent been clear enough :p).

My one question would be: how to use the navigation system to move my character?

The video I linked is where I currently am, I have AIs running around, hitting my character, character movements, skills and such. It all works well. Except I’m currently using “Add Movement Input” for my character movement and I’d like him to use the navigation mesh instead. I tried to simply use the node “AI move to” in the Character Blueprint but it has no effect and in fact returns an error “called function null” when used.

Since my enemy characters (AI) are running around properly, I know for sure that there is a navmesh bounds volume alive and working.

The workaround I’m thinking about is turning my Character Blueprint into a simple Pawn driven by the inputs of the Player Controller, is it the only way around?

Maybe I’m just dumb and don’t understand your answers ^.-

I’m using the Top Down template as a base but I basically erased everything and did everything from scratch.

If i understand correctly, you want diablo-like mouse controls?

Remove character movement component and add a custom AI component that fires the aiMoveTo command wheerever you clicked (convertMouseToWorld node).

Obviously needs a bit of massaging to work properly, but i think thats the general direction you want to pursue.

Thank you for your answer.

I was wondering where to go before I actually try to move all my stuff from one place to another.

Now I know how it’s going to be :slight_smile:

Have a good day!