Can Logic Nodes Use Variables to Point to Objects
13 July 2017 20:40
Hi,
Is there a way of avoiding hard coding object names into B4W logic nodes? I would like to pass the object name to the node is a value in a variable. This would make some of my logic trees much more compact and understandable.
For instance, the "Play Animation" node requires an object as its target. I would rather pass it a target in a variable.
Thanks!
Jem
Is there a way of avoiding hard coding object names into B4W logic nodes? I would like to pass the object name to the node is a value in a variable. This would make some of my logic trees much more compact and understandable.
For instance, the "Play Animation" node requires an object as its target. I would rather pass it a target in a variable.
Thanks!
Jem
14 July 2017 05:22
Short answer is no. But you could use a String Operator Node to compare string values then use Conditional Jump to play the corresponding animation. This might be just the complication you are trying to avoid however.
18 July 2017 17:52
Hi Will,
Thanks for the response. I understand your suggestion and I have tried implementing something like it. You are correct, the result does not simplify a fairly large logic tree. This does work. It is a valid technique.
I was looking for a more compact solution. My hope was to make a solution that was easily reusable from project-to-project and a bit more intelligible.
I am working not with JS callbacks to try to accomplish the same thing.
Thanks!
Jem
Thanks for the response. I understand your suggestion and I have tried implementing something like it. You are correct, the result does not simplify a fairly large logic tree. This does work. It is a valid technique.
I was looking for a more compact solution. My hope was to make a solution that was easily reusable from project-to-project and a bit more intelligible.
I am working not with JS callbacks to try to accomplish the same thing.
Thanks!
Jem