Slerp? Or some other function?

transform.position=Vector3.Slerp(transform.position,target.position,Time.deltaTime );

The code works, but what I’m looking for is something that will only work on one of the Vectors of the camera and target.
In other words let’s say I wanted to limit the movement of position to only X axis movement.
Is there another way to do this?

There are many ways to do this, perhaps the easier to understand is by using helper positions (c# code)

Vector3 targetpos, mypos;

targetpos = target.position;
mypos = transform.position;

//override / lock / whatever your desired axes
mypos.y = 10;
mypos.z = 5;
targetpos.y = 10;
targetpos.z = 1;

transform.position=Vector3.Slerp(mypos,targetpos,Time.deltaTime);

//apply additional transformation
mypos.x = 5;

//inject the calculated result back into the transform
transform.position = mypos;