I’m not sure if this is the correct place to put this, seeing as the solution may be something I’ve overlooked in the Behavior Tree, or if it’s something that will necessitate custom C++ code.
I have a Behavior Tree powering an AI controller. By default, it finds the location of an actor and moves towards it. However I’m looking to interrupt this behaviour when a specific event occurs. I’ve setup separate tasks and used a decorator to determine if the task has occurred, but notice that the tasks associated with the triggered event are actioned after the already running Move To task has completed (instead of interrupting it). I can see why this happens, but would like to know the best way of handling this situation.
Should I subclass the MoveTo BTTask and have it fail if it determines that the event has occurred, or is there an easy method of having the behavior tree reset to the root node and re-evaluate the situation?