Player direction in air

How can I make the player car to not be able to turn and change direction in the air?

if(transform.position.y > groundLevel)
{
disableRotation = true;
}

Main idea is:
If transform above some level then disable player controls or you can create boolean var isAboveGround in move script and change it on event when car in air to true and then check it if its true.

If you use a Character Controller you can do it like this.

if(!CharacterController.isGrounded){
// disable rotation. I have no idea how to do this. The Char Controller
// has no function to disable it. Maybe you can save the rotation and if
// the Player is not grounded you just replace it with the saved value every Update()
}

If you use a Character Controller you can do it like this.

if(!CharacterController.isGrounded){
// disable rotation. I have no idea how to do this. The Char Controller
// has no function to disable it. Maybe you can save the rotation and if
// the Player is not grounded you just replace it with the saved value
// every Update()
}