Created
November 20, 2016 17:03
-
-
Save jweimann/19e43c0fe801c8d38b253586c33ec7ab 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
public static void LookAtY(this Transform transform, Vector3 point) | |
{ | |
var lookPos = point - transform.position; | |
lookPos.y = 0; | |
var rotation = Quaternion.LookRotation(lookPos); | |
transform.rotation = rotation; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment