Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. if (Input.GetKey (KeyCode.Mouse0)) { //if left click is held down
  2.  
  3. Ray crosshairPoint = viewCamera.ViewportPointToRay (new Vector3(0.5f, 0.5f, 0.0f));
  4. Vector3 crosshairEnd = (crosshairPoint.origin + crosshairPoint.direction * 15);
  5. Debug.DrawRay (crosshairPoint.origin, crosshairPoint.direction * 20, Color.yellow, Time.deltaTime, false);
  6. Vector3 intersect = crosshairPoint.GetPoint (20);
  7. Debug.DrawRay (Vector3.zero, intersect, Color.red, Time.deltaTime, false);
  8.  
  9. Debug.DrawRay(_charFace.position, intersect, Color.cyan, Time.deltaTime, false);
  10.  
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement