llms.txt: machine-readable documentation index. Markdown version of this page is also available.

Ninja Bear Studio Plugins Help

Build a Patrol Route

Give the First Steps guard four posts to visit in order. Start with a duplicate Bot Setup and a copy of its main tree. Keep the chase behavior and replace roaming in the copy. The original guard can still roam.

Place four connected stops

  1. Create a Blueprint based on NinjaBotPatrolPointActor. Place four instances on the navigation mesh in a loop. Set each instance's Next Patrol Point to the following stop and link the last to the first.

  2. Give all four points a common Patrol Point Tag, such as AI.Patrol.Lookout. Register that gameplay tag in your project if needed.

  3. Create an Environment Query with an Actors of Class generator for NinjaBotPatrolPointActor. Use a search radius of 1400 and start the guard within that distance of a stop. Add a Gameplay Tag filter for your route tag and a Distance to Querier test with inverse linear scoring to prefer the nearest stop.

Query that finds a nearby patrol point on the tagged route

Replace the Roam sequence

  1. Add an Object Blackboard key named PatrolPoint with base class NinjaBotPatrolPointActor.

  2. In place of Roam, create a Patrol sequence. First add a Selector that succeeds if PatrolPoint is already set, or otherwise runs your EQS query and writes the result to PatrolPoint. For the first child, use a short Wait with a PatrolPoint Is Set decorator.

  3. Next add a sequence for using the point. Attach the Patrol Point Behavior service. Set its point key to PatrolPoint and its injection tag to AI.Dynamic.Patrol. Inside the sequence, Move To PatrolPoint, then Run Behavior Dynamic with the same tag and a short wait tree as the fallback.

  4. End the sequence with Advance Patrol Point, using PatrolPoint as its Blackboard key. Each new pass through the sequence now starts with the next stop.

Example patrol branch in a Behavior Tree

Replace the Roam states

  1. Add a root parameter PatrolPoint of type Actor Object Reference. Under Patrol, create states for finding the first point, moving to it, running its activity, and advancing.

  2. Enter Find only while PatrolPoint is invalid. Run your EQS query with the context actor as owner and bind the result to PatrolPoint. On success, transition to Move. If the guard already has a valid point, start at Move.

  3. In Move, bind Move To → Target Actor and Set Patrol Point Behavior → Patrol Point to PatrolPoint. Set the behavior task's injection tag to AI.Dynamic.Patrol.

  4. On arrival, transition to a Linked Asset state with the same tag and a short wait tree. When it completes, run Advance Patrol Point, binding its input and Result to PatrolPoint. Return to the patrol sequence to use the new point. Keep the transition to Chase when a player is sensed.

Example route through the patrol states

Give the lookout its own activity

  1. In the duplicate Bot Setup, assign your patrol tree and map AI.Dynamic.Patrol to the ordinary wait tree. Give one placed patrol point a longer wait using the matching Logic Type and tree. See Switch Behaviors at Runtime for both versions.

  2. Assign the duplicate setup to a guard and place it near the route.

Try It in Play

Stay out of view and watch the guard visit all four posts, pause longer at the lookout, and start a second lap. If it revisits the nearest post every time, check the Next Patrol Point links and make sure the query runs only when the stored point is empty.

25 November 2026