How to get an angle between 2 Vectors?

None of the answers worked for me. One pointed me in the right way, the find quaternion between vectors one.

This is how i did it. Basically i was trying to constraint the horizontal camera input depending on an angle related to the orientation of the character. So he could not look behind or “break” his neck in certain states.

I needed this angle to be > 0 when the vector camera looked too far to the right and < 0 when the camera looked too far to the left. This is where the other answers failed me as Acos returns positive always on both directions because it comes from the dot product.

So i complemented the quaternion solution by checking the Z axis of the vector that FQuat::ToAxisAndAngle returns.

If the angle goes left, axis.Z will be -1.0f and if it goes right axis.Z will be 1.0f. I multiplied axis.Z by my angle and it worked like a charm.

Hopefully this helps somebody.

327770-captura-de-pantalla-2021-01-21-184901.png