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.
Every tick my pawn enters a gate and updates attack delay until it is
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 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?
asked Oct 20 '14 at 05:53 PM in Blueprint Scripting
Follow this question
Once you sign in you will be able to subscribe for any updates here