# How to cancel a task correctly? (Behavior tree -\> MoveTo)

**URL:** <https://forums.unrealengine.com/t/how-to-cancel-a-task-correctly-behavior-tree-moveto/1781224>\
**Category:** AI\
**Tags:** unreal-engine, question\
**Created:** [April 1, 2024, 3:33am UTC](https://forums.unrealengine.com/t/how-to-cancel-a-task-correctly-behavior-tree-moveto/1781224 "2024-04-01T03:33:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [April 1, 2024, 6:51am UTC](https://forums.unrealengine.com/t/how-to-cancel-a-task-correctly-behavior-tree-moveto/1781224/2 "2024-04-01T06:51:10Z")

</div>

Ok… this way seems to work well  
-Aborts lower priority and reorganize branches like this.

 ![Captura de pantalla 2024-04-01 074309](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/6/0d6651dda585bb7428238cadc8ee9abd1bd19498.png)

The previous solution is not feasible for large trees.  
If anyone knows a better way please let me know.

Thank you!!

* * *

i see a lot of people are totally lost tryding to stop “MoveTo” since teen years ago… 😱

> [@Getting AI to interrupt/abort Behavior Tree MoveTo Task](https://forums.unrealengine.com/t/getting-ai-to-interrupt-abort-behavior-tree-moveto-task/306919/16):
>
> Somehow, even changing the abort condition to lower, won’t interrupt the pawn from running the lower branch’s moveTo completely before restarting the BT even when I follow closely to it as a pawn. Once it reaches its waypoint, the tree resets then goes for the left branch.

* * *

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-cancel-a-task-correctly-behavior-tree-moveto/1781224)._
