I’ve been trying to make a 2.5D game in Unity and I need the characters to jump similar to characters in BlazBlue. I’ve been trying to make it so that no matter the direction of the jump that the jump always reaches the same height:
I’ve been using rigidbodies that have everything except their x and y positions frozen and have apply gravity checked whenever I change the y velocity of the rigidbody. The problem is that changing the jump force makes the jump heights really inconsistent and sometimes doesn’t really make much change at all:
void Jump() {
if (Input.GetKeyDown(moveRight)) {
Vector3 vel = rigidbody.velocity;
vel.y = jumpHeight * jumpHeight;
rigidbody.velocity = vel;
isFalling = true;
airAction--;
}
if (Input.GetKeyDown(moveLeft)) {
Vector3 vel = rigidbody.velocity;
vel.y = jumpHeight * jumpHeight;
rigidbody.velocity = vel;
isFalling = true;
airAction--;
} else {
Vector3 vel = rigidbody.velocity;
vel.y = jumpHeight;
rigidbody.velocity = vel;
//rigidbody.AddRelativeForce (transform.up * jumpHeight, ForceMode.Force);
isFalling = true;
airAction--;
}
}
I’ve tried applying force already and using CharacterControllers seems to only make it worse. Is there any way I can acheive this effect?