Goomba AI - How to make AI walk Directionally rather than to Location or Actor

I am trying to work out how to use the blackboard/behavior tree to get a simple enemy walk in a direction relative to where the character is when the enemy spawns…

the behavior tree doesn’t seem to have a “move this direction” node rather a move to actor or location

I managed to get it to work directly on the character BP - but it is running off of a tick - Is there a way to make this inside of the behavior tree/blackboard?

Hi,

Yes, you can simply use a Task for this. The Move To node that behavior tree gives you by default is also a Task itself! To make a new Task, go into your behavior tree, and from the top ribbon, select New Task. You will be directed into this task which is just an empty blueprint editor window. From the left, select override button next to Function to override Receive Tick. Implement your movement logic here. Compile and close it. Go to the Content Browser where you’ll find this new task as a separate blueprint next to your behavior tree blueprint. Rename it to whatever you like. Now go back to your behavior tree, right-click and type its name to bring it to behavior tree. You can now use it just like Move To! Check out this awesome video tutorial by Epic on AI and behavior tree.

Note that the Owner Actor pin is your controller. You would want to first cast it to your base AI controller to make sure that it’s valid, then get its controlled pawn and then call Add Movement Input function (You probably don’t need to cast to your pawn).

Hope this helps.

TASKS!..I see haha thank you very much - I knew there was something I was overlooking…this is great thank you! :slight_smile:

You’re very welcome :slight_smile: