Skip to content

Instantly share code, notes, and snippets.

@DataGreed
Created April 19, 2020 17:32
Show Gist options
  • Save DataGreed/6e79d29b4ea1495c9695c51d52fed180 to your computer and use it in GitHub Desktop.
Save DataGreed/6e79d29b4ea1495c9695c51d52fed180 to your computer and use it in GitHub Desktop.
var angle = Mathf.PI/2 + Mathf.Atan2(-moveDirection.normalized.y, moveDirection.normalized.x);// * Mathf.Rad2Deg;
main.startRotation = angle; //this has to be set in radians apparantly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment