Hi I have made a behaviour tree that moves the AI between waypoints then if it sees a finish flag it should go move towards it and end up next to it, however the AI stops right before it gets to the finish flag then the move to sequence flickers.
In the Cpp:
if (LineOfSightTo(FinishFlag) && CheckInfront(FinishFlag)) // Check finish is a dot product calculation
{
GetBlackboardComponent()->SetValueAsVector(TEXT("FinishFlagLocation"), FinishFlag->GetActorLocation());
}
else
{
GetBlackboardComponent()->SetValueAsVector(TEXT("RandomWaypoint"), ChooseWaypoint()->GetActorLocation());
GetBlackboardComponent()->ClearValue(TEXT("FinishFlagLocation"));
}
In the behaviour tree