Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Input.GetKey (KeyCode.Mouse0)) { //if left click is held down
- Ray crosshairPoint = viewCamera.ViewportPointToRay (new Vector3(0.5f, 0.5f, 0.0f));
- Vector3 crosshairEnd = (crosshairPoint.origin + crosshairPoint.direction * 15);
- Debug.DrawRay (crosshairPoint.origin, crosshairPoint.direction * 20, Color.yellow, Time.deltaTime, false);
- Vector3 intersect = crosshairPoint.GetPoint (20);
- Debug.DrawRay (Vector3.zero, intersect, Color.red, Time.deltaTime, false);
- Debug.DrawRay(_charFace.position, intersect, Color.cyan, Time.deltaTime, false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement