Patrol function don't work inside my Behavior Tree

Hi guyzz!

I am trying to get a AI be able to patrol and if they see the player they will stop patroling and start chasing you. Patrol work well on it’s own but I want it to work within the same behavior tree as the other AI behaviors and for some reason the tree makes my patrol function give up half way through the process.

Currently the patrol function gets called and the enemy walks to one target point but it will not go to the second one from there. My guess is that the behavior tree interrupting it somehow by maybe calling it too many times or something? Anyone have any guess from a quick look at these screenies?

It’s a little hard to tell from the screenshots, but I’d do the following:

  • Check that Target 2 is reachable and within the nav graph
  • Swap the graph around so that the Patrol goes to Target 2, then Target 1. Does this complete properly or does it get stuck at Target 2, refusing to go to Target 1? (don’t forget to to change / remove the destroy actor node too)
  • Disconnect everything but the Patrol nodes in the behaviour tree. Does it complete then? If so, start adding the other nodes back in and check when it fails

Hi, Thanks for the tips!

The targets are always reachable and the patrol event works without any problems if I call it from a event beginplay instead of the behavior tree. But weirdly enough, If I erase the whole behavior tree and just have the patrol task call the patrol event the AI still just stops at target point 1.

So doesn’t work from Behavior Tree even if I even set it up as this:

This is the inside of the patrol task:

And this is the patrol event it calls that you can see see still just dies halfway through the thing:

So the custom event itself works fine but not when it triggers from the task or behavior tree I guess. Any ideas?

Temporarily solved by getting rid of the task’s finish execute on success that would make the event stop in it tracks over and over.