Sequence not running with abort

Burny

New member
Hello,

I have this simple BH-tree here.
The conditional checks if another Gameobject moved by some distance, if so it will return success.
My problem is, that its sequence only runs once, eventhough the conditional gets triggered successfully multiple times.

1747994518919.png


If I add another branch the first sequence runs when I want to.
1747995053647.png


What am I doing wrong? Why isn't the sequence running again on the first picture, eventhough the conditional returns success? And why does it run on the second picture?

Thanks for your help
 
Has Element Moved doesn't look like it returns success - it is reevaluating to failure in your top screenshot. As a reminder, conditional aborts trigger when the status changes, not only going from failure to success.
 
What exactly does "status changes" mean? How is the status changed if it's not the change from failure to success?


I have a debug in the conditional that fires when the conditional gets successful.
And if the sequence is running I have the Log "Sequence running"

1748009605607.png
1748009687843.png

If I check the console the first time the sequence runs as expected. The log of the conditional "has element moved is successfull" and the log leaf "sequence running" are triggered.
After that only the Log for the successful conditional is triggered, the Log leaf of the sequence isn't triggered anymore.
 
Is there a problem the TaskStatus.Success is only in one frame?

I've tested to trigger Success two frames with a bool and now the conditional triggers the rest of the branch.
1748028905428.png
 
In your screenshot the conditional task is returning failure. Conditional aborts are run before the tree executes so what may be happening is that your abort triggers once, and then the task is updated which calls OnUpdate again. Could your task be switching the status between the pre-evaluation and the actual evaluation?
 
So, if I understand it correctly, the OnUpdate() is executed twice then?
So it returns success before the tree runs, because the calculated distance is >4, then moves the position.
Then it runs again in the normal tree loop and because the positions to check are the same it returns failure?

But why isn't the Debug.Log triggered twice?
And why does it work, if I remove the second sequence in the first picture and run only the conditional branch? Shouldn't it process it twice too?

I've tested it another way by seperating the conditional to it's own parallel branch. Here again, the branch's sequence is running as expected.
1748369455622.png

Why does the conditional abort run, if it's on its own but as soon as I add another branch that isn't finished immediately it doesn't work?
Shouldn't a conditional abort be able to interrupt a running leaf?
 
There is a lot going on in that tree so I instead recommend breaking it down to a simpler tree to understand what is going on. In your tree you have a parallel task and since the parallel branches run independently they will not abort another branch. There is no "lower priority" within the child branches of a parallel branch since they run at the same time.
 
Back
Top