I’m currently using the BehaviourTree as part of my AI flow, however, I encountered one prominent issue in which calling :abort() on tree does not actually cancel the WHOLE tree and start from node 1 (which I assume is index 1 as documented).
I set up a very crude code to test this out and was able to recreate this problem.
local treeObj = {}
local tree = TreeCreator:Create(ServerStorage.NewTree10)
coroutine.wrap(function()
while true do
tree:run(treeObj)
end
end)()
task.wait(3)
tree:abort(treeObj)
print("Aborted tree")
Here’s also my Tree:
The code for the nodes are trivial as the Start node only prints and the Yield (as its’ name suggests), yields.
As for the result:
(it was unsuccessful)
My main tree for the AI, however, is much more complicated than this, so I would need it to break repeats, reset the whole tree pretty much.
*NOTE: My current usage of :abort() may also be incorrect, since the documentation for this particular method lacks in detail (I’m unsure, however).
Thanks.