Issue with a Third Person Shooter and line tracing

I’m not sure if I am using it right. I followed the link and used the sample formula they show on the wiki.

Original:
actor A, B;
vector aFacing,aToB;
// What direction is A facing in?
aFacing=Normal(Vector(A.Rotation));
// Get the vector from A to B aToB=B.Location-A.Location;
orientation = aFacing dot aToB;
// > 0.0 B is in front of A
// = 0.0 B is exactly to the right/left of A
// < 0.0 B is behind A

My code:
// A = StartingLocation, B = Hit.ImpactPoint

FVector AFacing = StartingLocation.Rotation().Vector().GetSafeNormal();
FVector AToB = Hit.ImpactPoint - StartingLocation;

// > 0.0 b is in front of A, = 0.0 b is exactly left or right of A, < 0.0 is behind of A
float Orientation = FVector::DotProduct(AFacing, AToB);
UE_LOG(LogTemp, Warning, TEXT(“Orientation is: %f”), Orientation);

if (Orientation > 0.0f)
{
StartingRotation = UKismetMathLibrary::FindLookAtRotation(StartingLocation, TraceEnd);
}

I also tried doing the second formula:

Original:
orientation = vector(B.Controller.GetViewRotation()) dot Normal(A.Location - B.Location);
// > 0.0 A points forwards in relation to B (up to 90° apart) // = 0.0 A is perpendicular to B (exactly 90° between A and B) // < 0.0 A points backwards in relation to B (more than 90° apart)

My code:
float Orientation = FVector::DotProduct(StartingLocation.Rotation().Vector(), (Hit.ImpactPoint - StartingLocation).GetSafeNormal());