Hello, I have a problem with my character, I have added a code to perform a jump, but rather than jump, it seems to teleport, as if the force of the jump was so much that it could not be appreciated, but I have exactly the same code with another character, and the other if it is seen as a jump, I thought it could be a problem of mass or gravity, but I have been playing with the values for a long time and I cannot get the jump effect, could you tell me if there is something wrong with my code?
private void Jump()
{
if (Input.GetKeyDown(KeyCode.UpArrow) && canJump == true)
{
jump = true;
}
if (jump)
{
rb2d.velocity = new Vector2(rb2d.velocity.x, 0);
rb2d.AddForce(Vector2.up * jumpforce, ForceMode2D.Impulse);
animator.SetBool("Jump", true);
animator.SetBool("Grounded", false);
jump = false;
canJump = false;
}
}
Mass and gravity scales, are set as default