I tested SwitchBehaviourTree action as below:
Tree1: Sequence->Print Log 1, SwitchBehaviourTree To Tree2, Print Log2
Tree2: Sequence->Print Log3
The result when run is: Print Log1, Print Log3, Print Log2, Print Log3, Print Log3, …..
Why “Print Log2” still run after call SwitchBehaviourTree Action
I’m using the lasted version of NodeCanvas in Unity Asset Store.
Help me, please.
Thank you very much.
Technically speaking, this happens because the Sequencer executes all it’s children in the same frame (in order), as long as none of them returns Running (which is the case here). I might be able to find a workaround solution for this, but may I ask what is the purpose of using an action in the Sequencer (like log in this example) after the “Switch Behaviour” action? Ideally, the “Switch Behaviour” action should be the last action of a sequencer for example.