Reply To: Access external object variables?

NodeCanvas Forums Support Access external object variables? Reply To: Access external object variables?

#13681
Gavalakis
Keymaster

Hello,

I am really sorry for this late reply.
Right now at least, Blackboard Variables can only be bound to the field/properties of components that are attached on the owner. However, you could set up a “Bridge” component with properties that in turn return (get and/or set) the properties you need from the child weapon prefab in runtime and bound those properties to blackboard variables. Unoptimized example code:

As a result, the bound variable to the ‘weaponAmmunition’ property, will in runtime return the ammunition of whichever weapon is currently child of the avatar with any logic you might want it to. You would of course still need to attach this “bridge” component on the owner gameobject though, but is this something you want to avoid completely?

Let me know.
Thank you.

Join us on Discord: https://discord.gg/97q2Rjh