Is there a way to get node hierarchy within the custom node?

Deadcow

New member
I want to get the tree hierarchy that leads to the custom node for debug purposes (otherwise it is really hard to find the culprit just by the mere log of the name of the node type and name of the owner). It is intended to be editor only, so maybe you have some tooling to traverse the tree?
 
Yes, the Behavior Tree component contains a BehaviorSource data object that you can then get the root task and traverse down:

Code:
BehaviorTree.BehaviorSource.RootTask.
 
Thank you. I checked the RootTask, it is a Task type and I was not able to find a way to get its child nodes 🤔 Also wasn't able to find anything in its NodeData or anywhere in the BehaviorSource.
How would you iterate over the tree from the RootTask?
 
You can check if the Task is a ParentTask, which then has the Children property. Take a look at Behavior.FindTask for an example (the runtime source is available through the downloads page).

The NodeData is on the task object itself.
 
Back
Top