Behaviour Tree Advice.

Hello!
For AI Patrol I use a simple, easy to expand, easy to debug way that work very well for me :

  • Make a TArray of AActor named “PatrolRoute” on The BotPawn (Fill the array on placed Pawn or at runtime on spawned Pawn with any AActor). This will be the patrol route.
  • Make a Blackboard variable of type Object->Actor named “PatrolRouteActor”
  • Make ABlackboard variable of type integer named “PatrolIndex”
  • Make a BTTask “ChoosePatrolPoint” to cycle through the array “PatrolRoute” (See below)

Sequence->ChoosePatrolPoint->MoveTo: “PatrolRouteActor”->Wait
voila.

BTTask ChoosePatrolPoint : [Edit] Forgot to say, don’t use “GetComponentByClass”, just Cast to Your BotPawn and get the Array