My behavior tree seems to be partially bypassing a blackboard condition.
In the screenshot I’ve attached, you can see the “Enemy set?” decorator evaluates to false (shown with the red mark next to the node), but the “Not close enough to enemy?” decorator below it is still being evaluated. In addition, it seems like the “Noise location set?” decorator isn’t evaluating to false (lack of a red mark), but it isn’t executing any of it’s leaf taks anyway. Meanwhile, the behavior tree is actually executing a totally different path on the right side. The decorators are set to notify observer on result change and abort both. The “Not close enough to enemy?” decorator only stops evaluating once the “Move To” task on the bottom right is finished.
I know the “Not close enough to enemy” decorator is running because the log prints a bunch of errors due to it trying to get an actor out of the “Enemy” blackboard value which is set to None. It’s not a huge issue, since I can just check if the actor is valid in the implementation of the decorator, but I’d rather not have to…
I’m using the perception system to change the blackboard values. When the enemy gets out of visual range, I null out the “enemy” blackboard value with Blackboard->SetValueAsObject(“Enemy”, NULL). Is this causing the issue? Maybe the nodes aren’t notified of the change or maybe they’re just not aborting? What’s the recommended way to have the perception system affect the behavior tree?