Angle Between Two Vectors in Unreal Engine 5

Table of Contents

Works in Unreal Engine 5. Tested on UE 5.8. Updated October 2026.

Quick answer: normalize both vectors, take the dot product, and pass it to Acos.

FVector DirectionA = VectorA.GetSafeNormal();
FVector DirectionB = VectorB.GetSafeNormal();

double AngleDegrees = FMath::RadiansToDegrees(FMath::Acos(FVector::DotProduct(DirectionA, DirectionB)));

The result is 0 to 180 degrees. In Blueprint: Normalize both vectors → Dot Product → Acos (Degrees).

Why this works

The dot product of two normalized vectors is the cosine of the angle between them: 1 when they point the same way, 0 at 90 degrees, -1 when opposite. Acos turns that back into the angle.

Always normalize first. Without it, the dot product also depends on the vectors’ lengths and the angle comes out wrong.

Angle between two vectors in Blueprint

  1. Add two Normalize nodes, one for each vector.
  2. Connect them to a Dot Product node.
  3. Connect the result to Acos (Degrees).

Is the target on my left or right? (signed angle)

The angle above is always positive. To know which side a target is on, use the cross product too:

				
					FVector Forward = GetActorForwardVector().GetSafeNormal2D();
FVector ToTarget = (TargetLocation - GetActorLocation()).GetSafeNormal2D();

double Dot = FVector::DotProduct(Forward, ToTarget);
double CrossZ = FVector::CrossProduct(Forward, ToTarget).Z;

double SignedAngleDegrees = FMath::RadiansToDegrees(FMath::Atan2(CrossZ, Dot));
				
			

The result is -180 to 180 degrees: positive means the target is to the right, negative to the left. GetSafeNormal2D ignores height, which is what you want for turning toward something.

Difference between two rotations

To compare two yaw angles, use FMath::FindDeltaAngleDegrees(A, B). It returns the shortest turn from A to B, between -180 and 180. For example, from 350 to 10 degrees it returns 20, not -340.

Common mistakes

  • Forgot to normalize: the angle is wrong. Use GetSafeNormal().
  • One vector is zero: the angle comes out as 90 degrees. Check that the vector isn’t zero before using the result.
  • Mixing radians and degrees: FMath::Acos returns radians. Convert with FMath::RadiansToDegrees.

Do you even need the angle?

Often not. To check if a target is in front, test whether the dot product is above 0. For a cone check, compare the dot product with the cosine of half the cone angle. That skips Acos entirely.

FAQ

How do I get the angle in degrees in Blueprint?

Use Acos (Degrees) instead of Acos. It returns degrees directly.

Why does my angle never go above 180?

That’s how the dot product formula works. Use the signed angle method above for -180 to 180.

How do I bounce a vector off a surface?

Use FMath::GetReflectionVector(Direction, SurfaceNormal). You don’t need the angle for that.

Related tutorials