title: Raycast point is not on plane Layer (wierd position)?
body: <p>Target: Get the point of intersection of the raycast with the plane's Layer.</p>
  
  <p>The raycast draws a line that intersects the plane (on mouse click).</p>
  
  <p>But the line also intersects everything in its path, so the outcome point is giving the point of intersection with objects other than the plane.</p>
  
  <p>I have assigned the layer of the plane as "Plane" and included in the code the layer of the plane only when raycasting.</p>
  
  <pre><code>        if (Input.GetMouseButton(0))
          {
              RaycastHit hit;
              int layerMask = (1 &lt;&lt; 8); // Plane's Layer
              var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
  
              if (Physics.Raycast (ray, out hit, layerMask)) {
                  transform.position = hit.point;
              }
          }
  </code></pre>
  
  <p>What is happening is that the position of the gameObject is overriding its old position until the object is clipping with the camera.</p>