Hey, in my project I have a BehaviourTreeOwner component that I need to dynamically load various unbound BehaviourTree assets into during runtime. As part of this, I need to copy over the blackboard from the asset into the BehaviourTreeOwner so the variables in it can be accessed during runtime. I’ve tried this a couple ways and neither seems to work:
(song is an instance of a class containing a BehaviourTree reference)
But this resulted in no variables in it getting updated during runtime even when the stock SetBoolean action was reached (and completing successfully).
Hmm. May I ask why do you need to copy the Graph Blackboard variables into the GraphOwner Blackboard Component?
When you load an Asset Graph into a GraphOwner (for example via owner.StartBehaviour(newGraph)), an instance of the graph is created and you can access the variables of the graph directly without the need to copy those variables into the Blackboard component attached along the GraphOwner. You can access those variables (the loaded graph’s blackboard variables) through owner.behaviour.blackboard. Since an instance of the graph is created when loading and starting an asset graph on a GraphOwner, modifying those variables will of course only modify the instance variables (and not the asset).