I have a 2002 Nissan Altima 2.5 L engine SL trim automatic transmission and every time the AC is on and the car goes into gear it sounds like that the engine is knocking but only when the AC is on when the AC is not on the car sounds fine what do you think could be happening at is this a expensive fix the car right now has a 190k I bought it used when it had 188000 miles
Well, that's a nearly 20-year-old car. It could very well be that the compressor is on its way out. Either that or your engine has worn bearings and the combination of transmission and AC compressor load is making the engine knock. Sometimes you'll get a knocking sound when bolts on the transmission flex plate get loose, but the AC would not affect that. Better have a mechanic check the problem out before it gets worse.
I meant to add that you should not run the AC until it's checked out. If it is a bad compressor, which is the most likely thing, when it finally seizes up it will contaminate the AC system with shrapnel and you'll have an even bigger, more expensive mess on your hands.
you could have a bad AC compressor pump