Handle mouse click on a gameobject - Unity3d
<p>I have a small city mesh and an apartment 3d model. I add the mesh to my scene and place the 3d model on the mesh.</p>

<p>I try to handle mouse click only on 3d model. I use below code. But  I click anywhere on the screen, it sets as sound = true</p>

<p>I add a mesh collider to 3d model gameobject.</p>

<pre><code>if (Input.GetMouseButtonDown (0)) {
            Plane p = new Plane (Camera.main.transform.forward , transform.position);
            Ray r = Camera.main.ScreenPointToRay (Input.mousePosition);
            float d;
            if(p.Raycast (r, out d)) {
                sound = true;
}   
</code></pre>

<p>How can I solve it?</p>