Need to restrict "air control" 2D platformer.

So I have a problem, it’s probably a noob one but here goes. I am trying to dial in my 2d platformer controller the way I want it. I want to prevent the player from controlling their direction while in air (grounded bool set to false). That way the player will have to try and judge distance and plan a jump ahead of time ( until they get access to a jetpack of sorts with limited fuel). I know that I can just place “if (grounded){” but when I do that the player doesn’t maintain the momentum in the direction they were moving before they left the ground. Oh by the way this is a physics based controller, as you could probably tell anyway.

Hi! Maybe the problem when your if(grounded) is that you’re moving the player respect to local space, while you have to move it respect to world space or vice-versa depends. Also, here’s a question that wanted to do the opposite with a script that it appeared to do what you want. http://forum.unity3d.com/threads/charactercontroller-move-in-air-control.99595/