How do I tap a ball? C#

This is probably very simple, but I cant figure it out. I’m making a game where you have to tap a ball to bounce it. The way it works now is that you can tap the screen to get it to bounce but that makes it way too easy.

			if (GUI.Button(new Rect(0, 0, Screen.width, Screen.height), ""))
				vSpeed = jumpSpeed;
				currentScore += 1;


Try doing a Physics.Raycast. You should be able to find what you hit

Your comment on @wijesijp’s answer is the first place where you mention 2D. The easiest solution is to to use OnMouseDown(). It works in both touch and mouse and it works in both 2D and 3D. The script has to be on the object that is to be touched:

void OnMouseDown() {
    //Do whatever when touched

Since it is a 2D collider, you need to use Physics2d.Raycast(). There is a bit of code here for the mouse that just needs to be converted to touch:

You may also want to look at Physics.OverlapPoint():