Hi, I'm a little confused about conditional abort. Below image is the example on document. Let's say at first time, "Can See Object" evaluates to Success, then Action(assume it to attack) begins to execute, in OnStart method, I play a attack animation, and start a timer to hurt the target at certain time periodically. Then at some time, "Can See Object" evaluate to Failure, the Action will be aborted immediately, OnEnd is called, I stop the animation and the timer. But if "Can Hear Object" also evaluate to Success, the Action will enter and execute again, and will repeat the OnStart, the animation and timer will be reset to start. If animation and timer is on half way when previous abort occur, this will cause incorrect behavior. Logically, Action is always valid, but with conditional abort, it experiences in-out-in stages. More generally, with conditional abort, Action's OnStart is not guarantee that the action is first execute, and OnEnd is not guarantee that action is really to the end. One solution is to use states to know if the action is enter or leave attack state. But if we rely on states, why not just use FSM?
I think I have some misunderstanding on how to use behavior tree correctly, so could you please show me how to use action with conditional abort, for example to solve this problem? Thanks in advance!
I think I have some misunderstanding on how to use behavior tree correctly, so could you please show me how to use action with conditional abort, for example to solve this problem? Thanks in advance!