> For the complete documentation index, see [llms.txt](https://thebitcave.gitbook.io/ai-brain-extensions-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thebitcave.gitbook.io/ai-brain-extensions-docs/aibrain-debugger/untitled.md).

# The AIBrain Debugger

The **AIBrain Debugger** tool lets you peek into some inner workings of an AIBrain and modify runtime behaviours.

![The AIBrain Debugger window](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LwrasyeRV4wc5R9FrtZ%2F-Lwrbc6U8fvYRZQiefqQ%2Faibrain_debugger_01.png?alt=media\&token=39e97835-88b2-4194-9bfb-e13d065a54d1)

To check the debugger in function, please watch the video below:

{% embed url="<https://www.youtube.com/watch?v=XBtZTbYjh20>" %}

### Opening the AIBrain Debugger Window

To open the debugger window, simply select from the Main menu *Tools > The Bit Cave > AI Brain Debugger*.

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LwrasyeRV4wc5R9FrtZ%2F-Lwrbp7M-riV5M5nWZWJ%2Faibrain_debugger_02.png?alt=media\&token=207bcd67-b3ea-493a-9d5b-72f59a90f752)

### Using the AIBrainDebuggable Component

To debug a brain, you will need an *AIBrainDebuggable* component, that is an extension of the regular MMTools *AIBrain*.To add such brain select *Add Component > CorgiExtensions > AI > AI Brain Debuggable*.

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LwrasyeRV4wc5R9FrtZ%2F-LwrbtVFXIYs816_5RFj%2Faibrain_debugger_03.png?alt=media\&token=23013598-47c0-4f27-8ab0-dfc3639db28b)

This brain works exactly like a regular brain, so you can add states and transitions, but it will give some more additional info to the debugger.

### Debugging an AIBrain

To start debugging a debuggable AI Brain, all you have to do is to play the scene from the Unity Editor and select a gameobject with an *AIBrainDebuggable*. The brain is divided in three main sections:

* *Brain state*
* *Transitions*
* *Target*

#### Brain State

The *Brain State* section shows the brain status during gameplay. Info displayed are:

* The selected gameobject
* Brain status (active or not)
* Current brain target (if any)
* The previous state and how much time the brain has been in it
* The current state and how much time has passed since the brain entered it
* Which actions the brain is performing

#### Transitions

This section will display all available states in the brain. Each state is displayed as a button, so you can force the transition if it is needed. A state can be:

* **\[C]** The current state: in this case the button will be disabled
* **\[>>]** A state connected with the current state
* A state disconnected with the current state

*Note that you can force the transition even to a disconnected state: this is pretty useful if you are working with the* [*Master/Slave brain features*](/ai-brain-extensions-docs/master-slave-brains/untitled.md)*.*

#### Target

This section will allow you to set the brain target or remove it if needed.

*Note that you can force any kind of target, not just the one selected by the brain.*
