I am trying to delete the object on which the mouse is clicked. I am making a 2D game using the new Unity3D 4.3. Here is the code I\'m using
void Update () {
You cannot use 3D physics functions on the new 2D stuff. Use the 2D functions instead. Example:
RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
if(hit.collider != null)
{
Debug.Log ("Target Position: " + hit.collider.gameObject.transform.position);
}