LookAt something but restricted to only one vector...

Hi any ideas in how to make an object looks at another object but only in one vector?.. this is what im looking for:

i want a player follows to another, what i have is the follower looks all the time to the main player, and is translated with charactercontroller simple move forward, it works… but i the main player goes upstairs, the follower rotates towards him, that is not what i´m looking for, i want the follower to rotate in Y not in Y and X… what could i do?..

thanks

transform.LookAt(new Vector3(target.position.x, transform.position.y, target.position.z));

Where target is the Transform of the object you are following.