Hi! I have a problem on my 2D game adding some force of type impulse to make the rigidbody jump and I can’t find out what I am doing wrong.Here is my code:
public void Jump()
{
if (isGrounded == true)
{
characterBody.AddForce(new Vector2(0, jumpForce), ForceMode2D.Impulse);
Debug.Log("jump");
}
}
This is working great, it even displays the “jump” message. I tried making the “jumpForce” variable ridiculously high to make sure I beat the gravity with no success. I tried to change the type from “Impulse” to “Force” and I noticed that the “Force” type is working but this is not what I need.
This is the rigidbody in the Inspector:
This has been on my mind for hours and I can’t figure it out. Can you please help me? Thanks!