title: Measuring raycast hitpoint of the specific object
body: <p>camera is casting a ray to any other object.
  I am trying to measure hit points(x,y,z) of specific object(screen3D).
  here is my code </p>
  
  <pre><code>public class EyeTrackingPoint : MonoBehaviour {
  public float sphereRadius=250.0f;
  public GameObject screen3D;
  public Vector3 ScreenPosition;
  private void Update()
  {
      RaycastHit hit;
      Camera cam = Camera.main;
      Ray ray = new Ray(cam.transform.position, cam.transform.rotation * Vector3.forward * sphereRadius);
      if( Physics.Raycast( ray, out hit) || hit.collider.gameObject.Equals(screen3D)) 
      {
          Debug.Log(hit.point);   
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>but, I got null reference exception error. what should I have to do to fix my error.
  nullReferenceException: Object reference not set to an instance of an object
  EyeTrackingPoint.Update () (at Assets/EyeTrackingPoint.cs:14)</p>
  
  <p>EyetrackingPoint.cs:14</p>
  
  <pre><code>if( Physics.Raycast( ray, out hit) || hit.collider.gameObject.Equals(screen3D)) 
  </code></pre>
  
  <p>Thank you for reading.</p>