[API Noob] How to calculate a relative angle in CPP/UE4

I will check it out. I wrote this code but it gives me the same results as the blueprint version which is horribly wrong. Thank you.



/*
The hardest angle to get. Looking towards the front of the ship on the target ship, whats the angle port (left) or starboard (right) 0-180deg
That the player ship is at. AoB = BearingToPlayerShip - (TargetShipRotation -  PlayerShipRotation) - 180 if on starbord. If on port its BearingToPlayership + ...
and if the result is not 0-360 range then add multiple of 360 until it is. I found that... it doesnt make much sense.
You can test this by rotating the tanker in the map and the AoB should be 90 stbd or 90 port depending on if its facing north or south.
*/
float UBPFuncLib_NauticalAngles::AngleOffTargetsBow(APawn* TargetPawn, APawn* PlyrShip)
{
	//Look into FMath::CartesianToPolar
	FVector v1 = TargetPawn->GetActorForwardVector();
	v1.Normalize();
	FVector v2 = PlyrShip->GetActorLocation();
	v2.Normalize();
	//float dp = FVector::DotProduct(TargetPawn->GetActorForwardVector.Normalize(0), PlyrShip.GetActorForwardVector.Normalize(0));
	float dp = FVector::DotProduct(v1, v2);
	float rads = FMath::Acos(dp);
	float angle = FMath::RadiansToDegrees(rads);
	UE_LOG(LogTemp, Warning, TEXT("The angle from the target ship forward to the location of the players ship is: %f"), angle);

	// ...
	if (!GEngine)
	{
		GEngine->AddOnScreenDebugMessage(0, 2.f, FColor::Cyan, "Debug on screen");
	}
	return angle;
}


Edit: Ive beenw atching khan academys trig and vector courses over and over but nothings clicking. All the other angles i can figure out for firing solution just not this one.