Reply To: Forcing reevaluation of BT to break all the running behaviours

Forums 💬 NodeCanvas 🗨️ General Discussion Forcing reevaluation of BT to break all the running behaviours Reply To: Forcing reevaluation of BT to break all the running behaviours

#14803
Gavalakis
Keymaster

    Hello,

    I can’t say Im exactly sure what you are after, but if you want to kind of restart the BT resting all node status, you can do:

    owner.StopBehaviour();
    owner.StartBehaviour();

    With that said, I really think that a valid way of what you want is to use events and Interruptors or Accessors.
    So you could create your MonoBehaviour and OnCollisionEnter of it, call SendEvent on the BehaviourTreeOwner.
    In turn your CheckEvent condition tasks assinged on any Inrruptor or Accessor will respond to that event and interrupt the child node.

    Let me know if you want a image of what Im suggesting here 🙂