Dynamic Variables

Dynamic variables are a useful feature of the blackboard that allows you to create locally-scoped variables that have a dynamic type. Dynamic variables will be scoped to the parent's subtree, so any sibling nodes and children will be able to use the same dynamic variable.

Take this tree, for example:

Dynamic tree

If a dynamic variable was created on Action 4, its parent Sequence, and its siblings Action 5, and Action 6 would all be able to access that variable. However Actions 1-3 would not, as they are not a part of the parent subtree. These dynamic variables will be assigned a type based on the value given to them. If a new value is assigned to the variable at any point, it will overwrite the old one, including its type.

To use dynamic variables, select the <Dynamic> option in the entry dropdown and enter the name for the variable. The name can be anything, even an empty string, but dynamic variables should generally be prefixed with an underscore.

Dynamic variable