I did it slightly different by defining a ResetJump()
method that I called instead in ApplyJumpForce()
:
private void ResetJump()
{
_timeInAir = 0f;
_rigidBody.velocityY = 0f;
}
And this leads me to my question: Should we really set the velocity to zero, or shouldn’t we rather just set the vertical velocity to zero, but keep the horizontal velocity as it is?
(Which is what I did)