I am trying to use global blackboard variable to bind with a game object’s field. And it is not working at all. If I change the variable, the global blackboard is not updating. I always have to manually update the global blackboard from the code. All the local/regular blackboard are binding with just fine though. Can anyone tell me what is the issue here?
Are you referring to data binding? If so what do you mean by saying “change the variable” please? Do you mean changing the variable name or the variable value (the field data binding)?
So what I mean is that the values of the variable in the global blackboard is not updating, if they are bound with a game object. For instance say, I have a global blackboard and I have a float variable “X” in it. This X variable is bound with a component that is on the same object. If I change the component’s value via code, I don’t see any change in the global blackboards X variable.
Basically, no data banding is working for global blackboard while normal blackboard that is auto-added with a graph owner is perfectly binding with other components value.
You are right. There is a weird behaviour when the class has [ExecuteInEditMode] (like GlobalBlackboard has) in combination with Unity’s “fast enter playmode”, where Awake apparently is not called when entering playmode. To work around this please open up GlobalBlackboard.cs and add the following line of code just after line #62 (in GlobalBlackboard.cs):
Thank you so much man for figuring out that I was having this issue with “Fast Enter Playmode”. And yes, your solution is working now. Please ensure to have this line added on the next update of Nodecanvas or my changes can be overwritten by your update 🙂