Script for jump when screen is touched (C#)

Hi Guys,

I am trying out a script for my player to jump when the screen is jumped, i am using the latest unity software and im making a 2d unity platform game.

Script

using UnityEngine;
using System.Collections;

public class AndroidJump : MonoBehaviour {
	public bool grounded = true;
	public float jumpPower = 1;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {

			if(!grounded && rigidbody2D.velocity.y == 0) {
				grounded = true;
			}
			if (Input.touchCount == 1 && grounded == true) {
				rigidbody2D.AddForce(transform.up*jumpPower);
				grounded = false;
			}
		}
	}

if you want to regester a screen touch on a device which I presume is what you are asking you could use

    if (Input.GetMouseButtonDown(0))
{
Jump();
}