Advertisement
Frank84

OrientEyes

Oct 6th, 2011
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.26 KB | None | 0 0
  1. float x = Input.mousePosition.x;
  2. float y = Input.mousePosition.y;
  3. const float ZDepth = 5.0f;
  4. Vector3 targetPosition = Camera.main.ScreenToWorldPoint(new Vector3(x, y, ZDepth));
  5. leftEyeTransform.LookAt(targetPosition);
  6. rightEyeTransform.LookAt(targetPosition);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement