Unity 2D game when transfered from PC to Android dialogue text changes too fast.

void Update () {

if (dialogueActive && Input.touchCount == 1 || Input.GetKeyUp(KeyCode.Space))
{
currentLine++;
}

I have a dialogue in the game and on the phone when I touch the screen one time it doesn’t go to the next line but to the 4th or 5th dialogue line. In PC with spacebar button it’s not a problem.

Hi,

Input.GetKeyUp returns true only when key is released (so basically once),
but Input.touchCount returns value every frame…

Maybe check for TouchPhase too,