What's wrong with my AI agent's Behavior Tree?

Forums 💬 NodeCanvas ⚙️ Support What's wrong with my AI agent's Behavior Tree?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15861
    dharma_42
    Participant

      Can someone help me understand why the second and third branch are never executed? Am I using the wrong selector for this kind of pattern using interrupt decorators for logic? A user on Discord told me about this method of using interrupts for logic, so as to avoid having to use dynamic selectors.

      #15862
      Gavalakis
      Keymaster

        Hello again,

        The Selector executes its child nodes in order from highest to lowest priority (left to right). It will return Success as soon as any child returns Success. It will return Failure if all children return in Failure.
        This means that when a child node return Success (as in your example) the rest of the child nodes will not execute.

        If you want to execute all child nodes you will probably need to use a “Sequencer” node, which is kind of the reverse of a “Selector”.
        The Sequencer executes its child nodes in order from highest to lowest priority (left to right). It will return Failure as soon as any child returns Failure. It will return Success if all children return Success.

        Please let me know if that works for you.
        Thanks!

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.