Created
July 15, 2015 10:19
-
-
Save shiwano/0f236469cd2ce2f4f585 to your computer and use it in GitHub Desktop.
Getting 360 angle between two 3d vectors for Unity3D.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Utility | |
{ | |
public static float CalculateAngle(Vector3 from, Vector3 to) | |
{ | |
return Quaternion.FromToRotation(Vector3.up, to - from).eulerAngles.z; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks