Jumping with Rigidbody.AddForce not working?

I sort of have two questions here. I’m trying to move my 2d player using velocity instead of transform.position, and so I switched my old one-line movement code to this:

rb.velocity = new Vector3(Input.GetAxis("Horizontal"), 0, 0) * moveSpeed * Time.deltaTime;

When I did this, suddenly my old jump script using Ridgidbody.AddForce went from being a smooth jump to sort of teleporting the player up into the air.

 rb.AddForce(transform.up * jumpForce, ForceMode2D.Impulse);

I think it has something to do with the the y value I’m setting to 0 constantly in the first line, but any help would be appreciated.

Well that is one reason why i do not like setting velocity values directly.

You should be able to solve your issue if you change your velocity stuff to:

 rb.velocity = new Vector3(Input.GetAxis("Horizontal")* moveSpeed * Time.deltaTime, rb.velocity.y, 0) ;