unity doesn't show me any errors but my character doesn't jump.
public bool isGrounded;
public float jumphight = 5f;
public Rigidbody2D rb;
void OnCollisionEnter2D(Collision2D other) {
if (other.gameObject.name == "Ground") {
isGrounded = true;
}
if (Input.GetButtonDown("Jump") && isGrounded == true){
rb.AddForce(new Vector2(0f, jumphight * Time.deltaTime), ForceMode2D.Impulse);
}
}
Comment