Move object faster when the screen is tapped repeatedly

Hello, I’m trying to move a 2d object upwards by tapping the screen. This is what I have so far.

if ((Input.GetKey(KeyCode.UpArrow) || (Input.touchCount > 0 && Input.GetTouch(0).phase== TouchPhase.Began)) && levelCompleted == false) {


locVel=transform.InverseTransformDirection(rigidbody2D.velocity);

locVel.y = locVelY;
			
rigidbody2D.velocity = transform.TransformDirection(locVel);



}

This script moves the object up in the same velocity when tapped. But I want the object to move faster when tapped repeatedly. How to achieve this ? . Your help would be highly appreciated.

Thank you.

I am newish to unity but what I would do is have a timer set to a default time and if the button/screen is clicked faster than the timer then “rigidbody.addForce(something here)” .

I hope that this helped you :smiley: