Search Unity

How to convert keyboard keys into mobile touch?

Discussion in '2D' started by musictree555, Dec 6, 2018.

  1. musictree555

    musictree555

    Joined:
    Dec 6, 2018
    Posts:
    1
    Hi,

    I am duplicating a guitar hero alike game on unity 2d but to be exported into an apk file. How am i able to change the codes to allow input touch on mobile? As of now, each block on unity 2d is binded to an alphabet key on my keyboard.

    void Update (){
    if(createMode){

    if (Input.GetKeyDown(key))
    Instantiate(n, transform.position, Quaternion.identity);
    }else{

    if (Input.GetKeyDown(key))
    StartCoroutine(Pressed());

    if (Input.GetKeyDown(key) && active){
    Destroy(note);
    AddScore();
    active = false;
    }

    }
    }