Thank you for the details of reproduction. Stoping the graph from within its own execution is indeed a bit problematic. To make this work, please change your action code to call EndAction(null) instead.
Debug.Assert(graph!=null,"The Finished Task System must be a Graph (tested with BehaviourTree only).");
base.EndAction(null);
graph.Stop();
}
}
EndAction(null) is used when we want to interrupt the action irrelevant of success or failure (which is relevant to this case since we stop the graph right after anyways), and will make the action completely reset to Resting.
You will still need to yield 1 frame just like you said before re-starting the graph in the onFinish callback (although I am looking into this and how to avoid this requirement).
Please let me know if the above change works for you.
Thank you!
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.