When I made my crouch/uncrouch system i made a line trace which detects if there is something above the player.