OnMouseDown alternative for Mobile

As the API states, OnMouseDown doesn’t work for Android/iPhone.

I have a script attached to a prefab that destroys the object when clicked on.

function OnMouseDown () {
    Destroy(gameObject);
}

Is there a way to easily do this for touch without the typical raycast or screentopoint? If not, how would I be able to implement this the easiest?

if you look in the unity wiki, they have a script that converts Onmousedown calls to touch friendly calls. This will allow you to use OnMouseDown without having to write all of the above each time you need to use the function.

today, you can use OnMouse functions on Mobile device…

Try this in some gameobject (untested):

void OnUpdate()
{
	foreach(Touch t in Input.Touches)
	{
		if(t.phase == TouchPhase.Began)
		{
			Vector3 point = new Vector3(t.position.x, t.position.y, 0);
			Ray ray = Camera.main.ViewportPointToRay(point);
			RaycastHit hit;
			if(Physics.Raycast(ray, out hit))
			{
				hit.collider.SendMessage("OnMouseDown", null, SendMessageOptions.DontRequireReceiver);
			}
		}
	}
}

As of 4.5 you no longer can on some platforms. Confirmed on Windows Phone that the mouse code is GONE.

Since it is possible to use the OnMouse_ Handler for mobile, is this http://wiki.unity3d.com/index.php/OnMouseDown the same what unity is doing internally? I wonder if it just suppresses the warnings.