How do I fix this?

I have a cylinder moving with “rigidbody.AddForce” function whenever player input holds down “w”. On release I stop it immediately with “rigidbody.velocity = Vector3.zero” and “rigidbody.Angularvelocity = Vector3.zero” But when jumping off of a plane into infinite space it stops all “gravity” mid air.

if (InputW)
        {
            rb.AddRelativeForce(new Vector3(0, 0, speed) * Time.deltaTime, ForceMode.VelocityChange);
        }

Are you saying that releasing ‘w’ causes the body to stop when it’s in the air? That’s expected since you’re setting the velocity to 0. You can set only the x- and z-velocities to 0 instead, and the vertical motion will be unaltered when jumping.