Using Horizontal Dot product might help. In this example this
is your character. When dot is 1 you are directly in front and -1 is directly behind while 0 is side by side.
float DotThreshold = 0.5f;
float DotFromEnemy;
DotFromEnemy = EnemyActor->GetHorizontalDotProductTo(this);
if (DotFromEnemy < (DotThreshold * -1f))
{
// Behind the EnemyActor
}
else if (DotFromEnemy > DotThreshold)
{
// In front of EnemyActor
}
else if (FMath::Abs(DotFromEnemy) <= DotThreshold)
{
// Side of EnemyActor
}