Created
July 1, 2019 16:08
-
-
Save CapitanLiteral/286d9faeaa05ae7e5ffe4035366bb153 to your computer and use it in GitHub Desktop.
This file contains 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
Vector3 diff = lookAt3dPosition - transform.position; | |
diff.Normalize(); | |
float rot_z = Mathf.Atan2(diff.y, diff.x) * Mathf.Rad2Deg; | |
transform.rotation = Quaternion.Euler(0f, 0f, rot_z - 90); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment