You could attach a box collider to the player where it intersects the ground, or set up a raycast that looks down, and if that trigger is false, you can set a grounded variable to false, and in your movement, check for the grounded variable. if not grounded, stop movement depending on however the movement was started.