How to get an angle between 2 Vectors?

Thank you everyone! got my angle calculation working thanks to this discussion :pray:

Here is the C++ code that might be useful - it basically a conversion of latest solution thats provided here in blueprints

float resultAngleInRadians = 0.0f;
firstVector.Normalize();
secondVector.Normalize();

auto crossProduct = firstVector.Cross(secondVector);
auto dotProduct = firstVector.Dot(secondVector);

if(crossProduct.Z > 0 )
{
    resultAngleInRadians = acosf(dotProduct);
}
else
{
	resultAngleInRadians = -1 * acosf(dotProduct);
}

auto resultAngleInDegrees = FMath::RadiansToDegrees(resultAngleInRadians);
2 Likes