I’m wondering about how blackboard dynamic variables work exactly.
I’m using them and everything “works”, but I notice some odd behavior sometimes and it might be related to the dynamicVars.
My question is: what’s the scope of a dynamic var? Can there only be ONE at a specific time in a single BT?
If I set and check a dynamic var in some node of the tree and then I do the same (with different values) in another node… am I overwriting the original one?
The scope of the dynamic variables is just like all other variables. They are accesible from all nodes/tasks like any other blackboard variable is. The real difference is that they are created at runtime instead of pre-created.
You can have as many as you want, but if you are setting a new dynamic variable and a variable with the same name and type already exist it will overwrite the old one. If not, a new one will be created.
If you are checking a dynamic variable and one exists with same name and type you will get it’s value, if one doesn’t exist you will get the default value of the type of that variable.