Skip to content

Instantly share code, notes, and snippets.

@z3t0
Created July 27, 2016 07:27
Show Gist options
  • Save z3t0/ce3c924d070d8ee5ddd876b12f97e82f to your computer and use it in GitHub Desktop.
Save z3t0/ce3c924d070d8ee5ddd876b12f97e82f to your computer and use it in GitHub Desktop.
if (Input.touchCount > 0) {
Ray touchray = Camera.main.ScreenPointToRay (Input.GetTouch (0).position);
Debug.DrawRay (touchray.origin, touchray.direction, Color.yellow, 5.0f);
}
Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
Debug.DrawRay (ray.origin, ray.direction, Color.green, 5.0f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment