My AI use a Behavior Tree that needs to run a subtree for a common behavior that can be on different AI (with different behavior tree).
I am searching a way to get a reference on the subtree blackboard component in C++, as I done on the behavior tree running on the AIController. Is it possible ?
I’m not sure what you mean. Every AI’s BT is run separately by its BehaviorTreeComponent and those components don’t know about each other unless you implement a communication pipeline of a sort to let them do that.
Have you tried synchronized BB keys? Maybe it’s enough to give you what you need?
Behavior tree running from other behavior tree doesn’t work as I expected, I believed we can make a small behavior alone and include it in any behavior tree with the Run Behavior task node (split behavior in module usabled by different AI), but it is not really the case, it seems to be here to avoid having a giant tree in the editor.
I have to change my conception, for the moment I just have to duplicate a piece of my behavior tree in an other if I want a small behavior for differents AI, so it’s no more problem as I was just searching an other way to do this.