Blackboard
The blackboard is a fancy way of saying variable list. Behavior trees use blackboards in order to share values between tasks. You can think of each task as a modular piece of functionality and the blackboard helps share data throughout the entire tree. In Behavior Designer your blackboard can look similar to:
This blackboard has six variables that are shared across the tree:
- 1 GameObject array.
- 3 GameObjects.
- 2 Integers.
These variables can then be used by the individual tasks by referencing them within the task inspector:
With this setup the Gather Animation Index variable will be set to the inspected task. This will then allow the task to reference the same value across multiple tasks. For example, another task could look like:
Since both tasks reference the same blackboard variable they will then share the same value. When the 5 value is set to the Gather Animation Index variable within the SetInt task that same 5 value will then be retrieved by the first SetInteger task. Behavior Designer offers a lot of flexibility with its blackboard. See the Variables page for more details.