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

Ninja Bear Studio Plugins Help

First Steps: Roam, Detect, and Chase

Build a guard that walks around until it sees the player, then follows them. Start with Set Up Ninja Bot, a playable character, and a level with a Nav Mesh Bounds Volume covering the test area. Press P in the level viewport to check that the floor is green.

Give the guard sight

  1. In the Content Browser, choose Ninja Bear Studio → Ninja Bot → Sense Profile. Add Sight to its senses.

  2. Set Sight Radius to 1200 and Lose Sight Radius to 1400. Under Detection by Affiliation, enable enemies, friendlies and neutrals for this first test.

  3. Set Dominant Sense to Sight. Save the profile.

Sight profile for the first guard

Give the guard somewhere to roam

  1. Create an Environment Query and add a Pathing Grid generator around the querier. Set Grid Half Size to 1000 and Space Between to 100.

  2. Add a Distance test from the querier. Filter for points between 300 and 1200 units away. Save the query as EQS_Roam.

Pathing grid for reachable roaming destinations

Choose One Tree

Create these keys so the sight service and the roaming query each have somewhere to write their results.

Key

Blackboard type

SensedActor

Object, base class Actor

FirstPerceivedLocation, CurrentTargetLocation, LastKnownLocation

Vector

CandidateScore, NormalizedCandidateScore, AccumulatedAwareness

Float

AwarenessLevel

Enum, with Enum Name set to EBotPerceptionAwarenessLevel

RoamLocation

Vector

Build the Behavior Tree

  1. Create a Blackboard with the keys listed above. RoamLocation holds the destination the guard picks for itself.

  2. Create a Behavior Tree using that Blackboard. Add a Selector under Root. Attach the Update Perception service and match its outputs to the Blackboard keys of the same name. Leave RoamLocation for the query.

  3. Add a Chase sequence as the leftmost child. Give it a Blackboard decorator checking that SensedActor Is Set, with Observer Aborts → Both. Add Move To using SensedActor and a short Wait after it.

  4. Add a Roam sequence to the right. Run EQS_Roam, store the result in RoamLocation, then Move To that key. Add Wait as the last child of the selector for when the query fails.

Perception service fields paired with their Blackboard keys
The Roam sequence finds a location and moves to it

Build the State Tree

  1. Create a State Tree with the State Tree AI Component schema. Add the Update Perception evaluator and a Vector root parameter named RoamLocation.

  2. Under Root, add Chase, Roam, and Idle in that order. Give Chase an enter condition that checks whether Update Perception → Sensed Actor is valid. In Chase, use Move To with that actor as the target.

  3. Under Roam, add Find Location and Walk. In Find Location, run EQS_Roam with the context actor as Query Owner and RoamLocation as Result. On success, go to Walk. On failure, go to Idle. In Walk, move to RoamLocation, then go to Idle.

  4. In Idle, add a Delay of one second, then transition to Roam. Give Roam and Idle a high-priority On Tick transition to Chase when Sensed Actor is valid.

  5. Give Chase an On Tick transition back to Roam when Sensed Actor becomes invalid. On completion, return to Root so the guard can choose again. Compile the tree.

Update Perception evaluator in the State Tree

Connect the tree and place the guard

  1. In the folder registered with the Asset Manager, choose Ninja Bear Studio → Ninja Bot → Bot Setup. Select your Brain Type, assign the tree you just made, and set Perception Sense Profile to your sight profile.

  2. Create a Character Blueprint. In Class Settings, add Bot Setup Provider Interface. Open Get Bot Setup Data and return your Bot Setup asset.

  3. In Class Defaults, set AI Controller Class to NinjaBotAIController and Auto Possess AI to Placed in World or Spawned. Compile and place the guard on navigable ground.

The character returns the Bot Setup it will use

Try It in Play

Start outside sight range. The guard should pick a destination and walk. Step in front of it and it should change course to follow you. Leave sight range and watch it return to roaming when the target clears.

If it stands still, inspect the active tree and check the navigation mesh. If it roams but ignores you, check the sight profile on the setup and the player's sight registration. Next, give roaming and chasing different speeds.

25 November 2026