Basic Concepts¶
Blocks¶
Blocks are the basic components form which everything is built. You create blocks by dragging them from the palette onto the canvas. They come in different colors too!
Blue blocks performs a test of some kind, be it a variable or some function. For example:

Red blocks execute some action, for example:

Purple blocks represent an event sent by Unity, for example:

Green blocks are custom blocks defined by you, for example:

Yellow blocks can be used to define a value you have created, for example:

Grey blocks are incomplete and have no effect until you combine them with other blocks, for example the UpArrow key from the beginner’s guide:

Variables¶
Many blocks contain variables. They represent unknown values that the block needs in order to know what to do.
A shout-out above the block lets you know there are unbound variables left to bind. Drop other blocks onto variables to bind them:
The blocks you drop on a variable will be bound and absorbed, like so:

If you want to rip the bound block out again, hold down Shift while dragging it.
Rules¶
When all variables have been bound you can snap the blocks together to form if-then rules:

If the up arrow key is pressed then move the player forward.
Snapping blocks on top of each other, vertically, creates a conjunction. If all of the left hand side blocks are true, then all of the right hand side blocks are executed:

Slots¶
Slots are used to store values and objects. Once set, they remember their value over time.
- Create a slot by clicking “Slot” in the “Create” menu in the toolbar. It will show up as “New Slot” in the folder for the current brain in the left panel.
- Rename a slot by dragging it onto The Workspace, double-clicking it, and typing a new name.
- Change its type by right-clicking on the slot in the left panel and clicking “Edit”.
- Set its initial value in the Inspector window by typing a value or by dragging a game object from the Hierarchy window onto it.
Slots are also automatically created when you drag a game object directly into the Brain Builder window. Suppose for example that we want to find out the distance from ourselves to the goal object. We find the “distance between position1 and position2” in the Math brain, and the “object position” in the “Position” brain. Dragging the “object position” onto the two position arguments will create the following rule:
The “this” object has automatically been filled in as the default argument for “object position”. In order to take the distance to the goal, you must drag the Goal object from the Hierarchy directly onto one of the “this” objects:
Looking in the inspector, you will se that a slot has been created and that it has been set to the Goal object: