I’ve been developing a 2D fighting game, and most things are going down smoothly, basic mechanics are almost over. However, I just can’t create a jumping that feels like a normal fighting game style jump.
For people not familiar with the genre, a jump should be a compromise you take. You should have ZERO control over your character physics after you’ve taken the choice to jump. Meaning you could be punished for a mistimed action. After all, it’s a competitive game. So it should jump a specific lenght and your only control over it should be to retreat backwards, go forward or just jump up. You can see the difference in the GIF’s below.
Right now, however, I can’t seem to be able to create such movement. I tried locking the player input in the air, tried using force to make him jump a specific distance… Nothing felt right, so I returned to a basic AddForce.
What it looks like right now in my game (with simple AddForce): Screen capture - 55d30a1c07a0479450d21947d8b11ced - Gyazo
What it should be:
Thank you for reading, hope you may be able to help me. Code below is the movement physics I’ve been using.
void FixedUpdate () {
rigid.velocity = new Vector2 (Input.GetAxisRaw ("LeftJoystickHorizontal1") * moveSpeed, rigid.velocity.y);
if (Input.GetButtonDown ("Abutton1") && isGrounded) {
rigid.AddForce(new Vector2(0, 250));
}
}