Skip to content

AIAgent

Cristian Geambasu edited this page Jul 25, 2016 · 5 revisions

AI Agent

The AIAgent component is responsible for running the Behaviour Tree(assuming the update mode is not set to Manual).

  • Behaviour Tree - A reference to a behaviour tree asset.
  • Body - The root game-object of the character.
  • Update Mode - Controls how the Behaviour Tree will be updated. You have three choices: Every Frame, At Interval or Manual. If you set the update mode to Manual you will need to call the AIAgent.Tick method from a custom script.

If the Debug mode is on the game will be paused when the Behaviour Tree hits a breakpoint. You can press the Edit button to open the Behaviour Tree Editor.

Blackboard

The Blackboard is a place where you can store variables and then read(or write) those variables in your custom Behaviour Nodes. Think of a Blackboard as the agent's memory. When you add an AIAgent component to a game-object, a Blackboard component will be automatically added as well. You can't remove the Blackboard component as long as an AIAgent component is present.

A Blackboard can store any type of variable but in the Inspector you can only add the following types of variables due to serialization limitations: Boolean, Integer, Float, String, Vector2, Vector3, GameObject, UnityEngine.Object(for assets).

See Also: Behaviour Tree, Behaviour Tree Editor, Scripting

Clone this wiki locally