Documentation

Learn how to use FlowCanvas

Download PDF Version

Blackboard Variables

The Blackboard is a place in which you store variables into and then read/write to those variables for any purpose. When you attach a FlowScriptController on a gameobject, a Blackboard is also attached for you automatically. This represents the Blackboard of the FlowScriptController and as such any graph that will be used by that FlowScriptController, will be using this blackboard. On top of this FlowScriptController Blackboard, the graph itself also has a local Blackboard of its own. When editing the graph, both Blackboards are appended together and both are available for you to use.

Blackboards can store any type of variable. In editor and when you click the “Add Variable” button though, it will seem that only a specific list of types will show up. To modify this list of types, all you have to do is open up the Preferred Types Editor and modify the list of types there. This is simply done for editor convenience and to avoid menu clutter.

Variables are able to be Data Bound to properties and fields on any component attached to the same game object that the blackboard is attached to (or any static property/field). This is extremely useful to create a direct bridge of a variable to a property/field both back and forth and thus interface with existing code directly. Binding a variable can simply be done through the gear variable button.

 

Variables on the Blackboard component also support prefab overrides more or less the same way that you would expect them! When a variable is overridden, a vertical blue-ish marker is displayed on the left of the variable name (similar to normal Unity marker). Applying or Reverting a variable can simply be done through the gear variable button as well.


Once you have created a blackboard variable, you are able to use it within any flowscript of the gameobject either getting its value or setting its value as you require. One of the easiest ways to do so is simply by drag & drop the variable from the Blackboard and into the graph editor.

If a variable refers to an asset (prefab, texture, etc), a nice asset preview will also show up within the node!

AssetPreview

Yes No Suggest edit
8 of 8 users found this section helpful
Suggest Edit