Has it been raining lately? It could be a clogged sun roof drain. Or, as you probably suspect, AC condensation is not draining out as it should. in any case, take it to a dealer soon. Moldy smelly carpet is not fun nor healthy.
Condensation water on AC pipe accumulated on a level place somewhere. When the car is tilted it pours and water runs into the cabin from some crack. Interesting though, maybe some water seal was not installed properly around the dash and cabin.