Getting the degrees difference between a two actor

HI I’m having real trouble writing this function.

I want to get the difference between a actor rotation and the look at rotation of a desired actor. I would like to calculate this as a degree, with one direction being negative.

So this is roughly want I would be hoping to achieve:

Any idea?

This should give you a negative or positive rotation in degrees between 2 normalized vectors (“Vector1” and “Vector2” on a given plane with normal “Normal”)

UKismetMathLibrary::DegAtan2(FVector::DotProduct(Normal, FVector::CrossProduct(Vector1, Vector2)), FVector::DotProduct(Vector1, Vector2));

I have two versions I use to get angle between vectors:

And the second one produces a result with actual sign thus you can decide the direction to rotate in certain situations when needed. Haven’t used it much so no promises it being good :slight_smile:

Great thanks so much