
UFUNCTION(BlueprintCallable, Category = "AI | Facing")
void HandleDirection(AActor* act);
void AEnemy::HandleDirection(AActor* act)
{
if (!IsValid(act))
{
return;
}
FVector targetLoc = act->GetActorLocation();
FVector selfLoc = GetActorLocation();
bool bShouldFaceLeft = targetLoc.X < selfLoc.X;
SetToLeft(bShouldFaceLeft);
}