Behaviour Tree: Action on Abort?

Hi there,

I’m using behaviour trees for certain tasks and would like to make sure that if any of a sequence of tasks fails then another task will run to clean up before flow goes back to the root of the tree.

For example I have a sequence of tasks that pick up an actor and carry it to a location and drop it off:

Sequence 1:

  • Find actor to pick up
  • Move to pick up actor
  • Pickup the actor
    Sequence 2:
  • Find drop off actor
  • Move to drop off actor
  • Drop off actor

If any of the last 3 tasks fail then the character is stuck holding the actor.

I don’t want to put a drop task at the leftmost of the tree as this could interfere with other behaviours.

I want them to move to a clear location and drop the actor if and only if the second sequence is aborted and then go back to the root of the tree.

Is there a way to do this do this with the default composites, tasks and decorators?

If not I’m thinking I might create a new composite which is like “Simple Parallel” but it the left pin can be a sequence (rather than just a task in the case of Simple Parallel) and the right pin would be tasks to execute if only if the left pin fails. I’m actually going to try that now but hopefully someone will get back to me and let me know that it’s completely unnecessary and there’s an easy to way to do what I want to do.


Okay I think what I want to do can be done without a new composite:


  • Sequence [Left]:
    • Find drop off actor
    • Move to drop off actor
    • Drop off actor
  • Sequence [Right]
    • Find free location
    • Move to free location
    • Drop off actor

Still some edge cases but I think it will work.