So, as the title suggests, I want to exit out of the right-side sequence once the condition is set.
when im out of combat, it follows me as expected. however, if i enter combat while it’s still following me, it waits until catching up to stop following me. How could I change this behavior for the AI to listen to any changes in the bIsInCombat Variable?
I’m not sure if there is a more correct way to do it but I just call the following:
auto controller = Cast<AAIController>(Cast<ACharacter>(GetOwner())->GetController());
if (controller) {
auto bbc = controller->GetBlackboardComponent();
if (bbc) {
bbc->GetBrainComponent()->RestartLogic();
}
}
Instead of using Move To, use your own Behavior Tree task where you use the AI Move to node and keep also evaluating the combat status (which the finishes execute if it is valid)