# 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](/files/-Lwrbc6U8fvYRZQiefqQ)

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*.

![](/files/-Lwrbp7M-riV5M5nWZWJ)

### 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*.

![](/files/-LwrbtVFXIYs816_5RFj)

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.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thebitcave.gitbook.io/ai-brain-extensions-docs/aibrain-debugger/untitled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
