I am making my character jump when the phone screen is touched. I have this which should work based on what i have found searching the internet but it doesn’t register the click on a mouse or when i touch on a phone. I have no idea what is wrong, can anyone point me in the right direction.
public float jumpHeight = 500f;
void update () {
if (Input.GetMouseButtonDown(0))
jump ();
}
void jump() {
Debug.Log("Jump.");
GetComponent<Rigidbody2D>().AddForce(Vector2.up * jumpHeight);
}
}