Behavior Tree sequence always executing even on success

I going through setting up a basic AI but am having a bit of trouble with the transition from attacking to movement when the last enemy is killed. My understanding of the Selector node was that it would execute untl success then collapse up the tree ignoring un-executed tasks. This seems to work fine on the attacking side of my tree but not on the movement side of things.

As you can see my Behavior Tree uses a selector to execute two tasks. One finds the location it is going to go to and the other tells the character to move there. This in general works fine until one final use case where the last visible enemy is killed and the AI returns to the movement branch of the tree. They are technically still animating their attack so they need to delay just a little bit before moving again.

18427-btree.png

Every tick my pawn enters a gate and updates attack delay until it is <= 0 at that point the gate closes and the attack is ready to be used again because the animation has finished. I figured this number could be reused as a “isAttacking” queue.

To account for this delay before movement as well, I do a quick check at the end of my BTT_FindRoute. The pawn calculates how long is left on the animation (modified by attack speed buffs / debuffs which are not implemented yet so can be considered modifiers of 0) So, grabbing the AttackDelay from the pawn, I check if it’s <=0 If it is I finish execute with success false so it will execute the next node and allow movement. If it is not I finish execute with success true so it will collapse up and ignore the move to task.

However, it always does the move to regardless of which finish execute is used. Is my understand of how finish execute works incorrect? When collapsing up the tree does it not skip unexecuted tasks? Should this be done a different way all together?

try as I might, this is still happening. is someone able to explain how I should be preventing it from executing the move to node? maybe point me to the decorator documentation? There are some I’m not sure about like cooldown that sound almost appropriate.

Hey, just curious to know if you ever found the answer to this.

Your setup looks good to me, although I would have explicitly used a custom decorator checking for Pawn’s attack delay <=0 on the ‘move to’ node or even a global boolean ‘isPawnFreeToMove’ and used that as a blackboard IsSet decorator to control more potential usecases.

I never found an answer. At this point it is more of a small bug that I can live with until we get to Alpha. It is strange though.