Debugging not-yet-instantiated BehaviorTrees

utwsoft

New member
I would like to set a breakpoint on a task, but on an ExternalBehaviorTree, such that when its instantiated and attached, the breakpoint would hit in BehaviorDesigner.

Right now, my code instantiates a GameObject, instantiates an ExternalBehaviorTree, attaches it, Ticks it, finishes, and then gets destroyed. The instantiated BehaviorTree is only alive for a split millisecond, so it's not practical to wait for the BT to exist before setting a breakpoint.

The only other way I see this is possible is simply setting breakpoints in the C# script. While not ideal, it's workable. It'd be nice to see the Behavior viewer break on instantiation.

Is this possible?
 
If you are adding and removing the tree within a single frame the editor won't get a chance to attach to it. Your best bet is to add a C# breakpoint within a task that is executed during that single frame.
 
Top