I have a problem with the Unity game engine. I am making an Android game. I want to move an object by a small distance every time the user taps the screen, but not when the user holds the screen.
This is my current code. When the user holds the screen, the object keeps moving. I want to only move the object once the user touches the screen and not move it again until they released it:
void Update () {
if (Input.touchCount > 0) {
transform.position = new Vector2(transform.position.x, transform.position.y+0.1f);
}