Skip to content

Instantly share code, notes, and snippets.

View sui77's full-sized avatar

Suat Özgür sui77

  • MindGeek
  • Hamburg, Germany
View GitHub Profile
Vector2 GetMouseDirection(float distance) {
Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
float xp = body.position.x;
float yp = body.position.y;
float xm = mousePosition.x;
float ym = mousePosition.y;
float a; float b; float angle;
if (xm >= xp && ym >= yp) {