make the AI walk randomly when it reaches a patrol point

how can I make it so that if the AI arrives at a patrol point, it starts walking randomly and after a while returns to the patrol point?

here is the blueprint for the patrol system:



the Behavior Tree:

Ah, Behavior Trees.

Can’t help you there. I code AI manually.

But, logically speaking:

  1. Does your character successfully arrive at the PATROL POINT?
  2. What is their current behavior after arriving there?
  3. What are the conditions of the random roam once they are there? (How long to roam? How far to roam? etc.)

you could probably reuse some code here, have a node ‘find move location’, in the node check if it wants a patrol or random location and return it.

keep move to as a separate node which you have already instead of patrol node and a moverandom node.

just in case you mean how to find a random location there is a function called getrandomlocationinreachableradius()

thanks, that worked perfectly! :smiley:

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