As stated earlier, the easiest way to make use, meaning getting or setting a made Blackboard variable, is to simply drag & drop that variable from the Blackboard and into the canvas.
Selecting to get a blackboard variable, will create a variable node, linked to that blackboard variable. The“$” token is always used before a name, to indicate that it is a linked blackboard variable name. In this example “$myInteger”. The single Value output port of the node, will return the value of that linked variable.
Selecting to set a blackboard variable on the other hand will create a different type of node as seen bellow. A callable node. As such, the value will only be set when the node is called with a Flow signal and by default will be set to be equal to the value input parameter connected.
In the node inspector of the node above, you are also able to specify an operation to be used when setting the variable. Instead of simply setting the variable to be equal to the value parameter, you can choose to add, subtract, multiply, or divide the value parameter instead. This can potentially save a bunch of nodes required to do the same thing, and keep the graph cleaner.
You don’t always have to use Blackboard Variables though. In some cases you may simply want a constant variable used in some place and nowhere else. In these cases, it’s best to simply create a GraphVariable node as illustrated bellow and set it’s value directly through the node inspector.
Another, probably much simpler way though, is to simply drag and drop a input from a node into the empty canvas and selecting the option “Make Graph Variable”!
Later on, if you change your mind and want to link this node to a Blackboard Variable instead, you can simply do so through the inspector by clicking on the radio button!