Hi I m new to unity and making a game for android .But there is a problem, the player is allowed to jump when space bar is pressed or when tapped. when i play the game and see the game view the player jump is just fine as I want when space bar pressed, but when i connect my android device to computer and use unity remote and play the game ,the player jumps very high when tapped.I built the file and installed on device but the Player still jumps higher.I don,t know what is the problem here. Please Help.
here is the code to control the player
void Update ()
{
if ((Input.GetKeyDown(KeyCode.Space)||Input.touchCount==1)&&isAlive)
{
if (grounded)
{
rb.AddForce(rb.velocity.x, jumpHeight, rb.velocity.z);
//jumpHeight value is 350;
grounded = false;
}
}
if (!finished&&isAlive)
{
Vector3 currentPosition = this.transform.position;
currentPosition.x += this.forwardSpeed * Time.deltaTime;
this.transform.position = currentPosition;
}
}