Stopping a task before completed?

JohnG

Member
Can you or how do you break out of a task? For instance, a wander task is moving from A to B (20 steps away), however at position C (5 steps away from A), something happens and you no longer want the agent to move to position B.
 
You can use conditional aborts for this situation:

 
These Conditional Aborts don't seem to do anything.

In my setup, I have a radius of 10 on the left and 5 on the right. The selector never breaks to run the right sequence when I'm within range.

1596660828930.png
 
These Conditional Aborts don't seem to do anything.

In my setup, I have a radius of 10 on the left and 5 on the right. The selector never breaks to run the right sequence when I'm within range.

View attachment 3607

Selector checks the left branch first. If target is within 5 units, it's also within 10 units obviously. The left branch condition covers the right branch condition, that's why it will never execute the right branch. Swap the branches under selector and switch conditional abort to "both" instead of "lower priority". So that smaller radius branch will cancel itself when condition fails.
 
Selector checks the left branch first. If target is within 5 units, it's also within 10 units obviously. The left branch condition covers the right branch condition, that's why it will never execute the right branch. Swap the branches under selector and switch conditional abort to "both" instead of "lower priority". So that smaller radius branch will cancel itself when condition fails.

Awe, that worked thanks!
 
Top