I used a boolean checking for contact with ground. A jump makes it false and landing makes it true. When jump input pressed, jump only if boolean is true. A better way is to use a raycast downwards. If distance from ground is less than some value, then jump.