How to know the angle between two vectors?
I am making small game with pygame and I have made a gun that rotates around its center.
My problem is that I want the gun to rotate by itself to the enemy direction, but I couldn’t do that because I can’t find the angle between the gun and the enemy to make the gun rotate to it
I have searched and I found that I have to use the
atan2 but I didn’t find any working code so I hope someone could help me.