Hello. I make a game on Unity3D 4.6. I made the game, everything is fine on the PC, the control on the keyboard works, but I need to control it on Android, but I just can't. Help me please. Here is my script, the movement is performed by pressing the button (KeyDown) and releasing the button (KeyUp):
void Update(){ if (movePlayer){ //прижок if (grounded && (Input.GetKeyDown (KeyCode.UpArrow))) { //стрибок rigidbody2D.AddForce (new Vector2(0f,jumpForce)); //Включається анімація стрибка anim.SetBool("jump", false); //Координати колайдера boxCollider.size = new Vector2(1.6f, 0.48f); boxCollider.center = new Vector2(-0.08f, -0.71f); } //Приседание if (Input.GetKeyDown (KeyCode.DownArrow)) { //Включається анімація пригинання anim.SetBool("leam", true); //Координати колайдера boxCollider.size = new Vector2(2.0f, 1.5f); boxCollider.center = new Vector2(0.23f, -0.1f); } if (!grounded && (Input.GetKeyUp (KeyCode.UpArrow))) { //Координати колайдера boxCollider.size = new Vector2(0.54f, 2.89f); boxCollider.center = new Vector2(-0.06f, 0.19f); } if (Input.GetKeyUp (KeyCode.DownArrow)) { //Виключається анімація пригинання anim.SetBool("leam", false); //Координати колайдера boxCollider.size = new Vector2(0.54f, 2.89f); boxCollider.center = new Vector2(-0.06f, 0.19f); } //Повернення до початку гри if (Input.GetKey(KeyCode.R)) { Application.LoadLevel(Application.loadedLevel); } } }