Unable to get one pawn to move towards another

I have two pawns, a hero and enemy pawn. In my game the player does not control either however I want to the hero pawn to move towards the enemy pawn kind of like what you would see in a RTS. It looks like everything is hooked up correctly because when I debug my behavior tree I can see the move action being called with the appropriate target. (The red line in the video is a debug line I’m using to make sure my hero is finding the closest enemy.)

I have a nav mesh set up but for some reason there’s an empty space around my pawns so maybe that’s indictive of an issue?

I’ve also just tried to run the Simple Move to Location on event tick with now luck so it feels like I’m missing something in my setup. Is there a movement component or something like that I need to have on these pawns?

Yep :innocent:

There are still other ways to move pawns or other actors, but a character class would fit your use case better anyways.

2 Likes

Have you verified whether the move to target is being set correctly in your AI controller? Also simple move to would be better used on an event not tick, also what Vis Agilis mentioned using character classes would be better, I never tried controlling pawns with AI controllers, not that it wouldn’t work but the character preset class has everything setup you’d need to just plugin your AI controller and go

Why would a character be better? I thought characters are used when you want the player to control something.

I tried changing both my hero and enemy to character types along with updating my behavior tree but still no luck.

As far as I can tell the target is being set correctly. That’s the red line in my video. Adding a breakpoint in my code shows the correct object value in my Set Value as Object call.

Because character class blueprints have the character movement component, which is what you’re trying to utilize I assume.

Could you also show us your task where you handle the movement logic?

Here is the logic in my AI controller (I think this is what you’re looking for)


I’m finding the closest enemy based off of some components and tags and then calling the move entry in the behavior tree. I don’t have to tell my character how to move, right? That’s the point of using the character?

Oh I thought it was a custom task of yours for a moment.

Now, can it be because you trigger it once on possess? :thinking:
Try using on perception updated instead.


The reason to use a character class blueprint can have different reasons. But in your case, it seems like you’d be better off with a character blueprint for your enemy because you’ll wanna use the character movement component.

I don’t think so. I was following a video found here and they are doing it with the on possess event. I think it’s working because I’m seeing my behavior tree continuing to trigger. I feel like I’ve got something set up incorrectly as I started with a blank project. I’m going to try and start with a third person project and migrate some stuff over to see if that helps.

your correct about this, something in your Actor is affecting the navmesh, since it seems to be just a cube search on it for CanEverEffectNavigation and turn it off.

1 Like

Thank you very much. This was part of the problem. The other part was not having these components as characters.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.