Code Help

This original code makes the camera follow the Main Character.

if self.FreeFlowCam == 1:
            camvec = self.Phena.getPos() - base.cam.getPos();
            camvec.setZ(0);
            camdist = camvec.length();
            camvec.normalize();
            if (camdist > self.camCloseFar):
                base.cam.setPos(base.cam.getPos() + camvec*(camdist-self.camCloseFar));
                camdist = self.camCloseFar;
            if (camdist < self.camCloseNear):
                base.cam.setPos(base.cam.getPos() - camvec*(self.camCloseNear-camdist));
                camdist = self.camCloseNear;

Can someone show me how to do the same thing, but make the camera only move along its X axis or its Y axis?

I think I solved this already. I guess I’m getting brain tired. Was very easy to solve; the tricky part is getting the camera to change what side of the Character it sits on, but I think I’m about to solve that one as well.

Getting back to it, now. 8)