[2D] How to make a jump up and right using a single keypress?

Hello, I am creating a small 2D arcade game and I have a problem with jump with just one keypress. My “hero” is rigidbody with collider2D… Example in the figure below.

Just … one press and jump up and right :slight_smile:

Thanks for any help in advance.

rigidbody2D.AddForce((transform.up * jumpHeight) + (transform.right*jumpDistance));

Have you tried something like that? jumpHeight and jumpDistance are just floats that you define.

@akillingbeck, @NorthStar79:

Thanks for the replies but none of them unfortunately helped.

Ball jumps a little to the side and then just up :frowning:

101320-ezgifcom-video-to-gif.gif