I would like to achieve something like I crafted on the attached picture, where: myFloat – local blackboard float variable Global_BB – global blacboard myVar – global blackboard (Global_BB) float variable
Unfortuanetely at this moment I can’t find Global_BB on the Bind Field dropdown. Could you please tell me if it is possible? Thanks!
The Bind Variable dropdown, is for binding the variable to component properties and/or fields attached on the same gameobject as the blackboard. So, binding blackboard variables to other blackboard variables is not possible right now, but it’s a nice idea which I can take a look at and see what can be done 🙂
Is there a reason why you don’t want to use the Global Variable directly from within the graphs by the way?
Every Sub use the same Graph, so every Sub-A use Graph-A, Sub-B use Graph-B, and so on.
But every graph make some operation on a global variable, and every Object use other variable.
I presume you lost already, so example:
Lets say:
Object-1 use Global_BB.MyFloat_1
Object-2 use Global_BB.MyFloat_2
etc.
So:
Object-1 > Sub-A make Graph-A operations using Global_BB.MyFloat_1
But:
Object-2 > Sub-A make Graph-A operations using Global_BB.MyFloat_2
Same way:
Object-1 > Sub-B make Graph-B operations using Global_BB.MyFloat_1
Object-2 > Sub-B make Graph-B operations using Global_BB.MyFloat_2
And so on.
Lets say I have several Objects like that. If I use Global Variable directly I must edit a lot of graphs which are the same but differ only by the variable it uses. So I get an idea that I make local variable on every object and then bind this local variable with proper Global variable, so Sub will use local variable, and don’t have to be edited every time, so I can reuse my graph easily.
It is not an urgent matter – I bypassed this problem with my custom script, and omitted Global Blackboard at all. But it is an interesing issue so I am curious if it is a way to achieve this with a Node Canvas 🙂
If you don’t understand something, then please ask – I will be glad to explain it more. Maybe it will help someone or inspire you to some new feature 😉
Hello again and thanks for the explanation.
I will take a look at this idea and see if it can be implemented somehow.
Meanwhile, an alternative way of working around this, could be to create a script, then data bind the variables to this script properties. In turn the script properties will get/set global variables. So it’s like using this script as a ‘bridge’ between local and global blackboard.
Lobal Blackboard -> Script -> Global Blackboard
For example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
publicclassPropertyBinding:MonoBehaviour{
privateGlobalBlackboardbb{
get{returnGlobalBlackboard.Find("Global");}
}
publicfloatmyFloat{
get{returnbb.GetValue<float>("myFloat");}
set{bb.SetValue("myFloat",value);}
}
publicstringmyString{
get{returnbb.GetValue<string>("myString");}
set{bb.SetValue("myString",value);}
}
}
Of course it’s not the same as your request since it requires more work, so I will take a look at the possibility of your original request.
Thanks.
Join us on Discord: https://discord.gg/97q2Rjh
Author
Posts
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.