why i can do a smooth look at, but only rotate the z axe?

smooth look at, but only rotate the z axe.

What?

Please rephrase your question fully in a manner that we understand what it is you’re attempting to do.

Is this for 2d, just curious?

To get a smooth lookat, you use Quaternion.LookRotation:

If you want to turn on one axis, you give a target position that has the position of the transform.z so:

 Vector3  newPosition = new Vector3(target.position.x,target.position.y,transfrom.position.z);
   void Update() {
       Vector3 relativePos = newPosition - transform.position;
       Quaternion rotation = Quaternion.LookRotation(relativePos);
       transform.rotation = rotation;
   }

edit: you have to use quaternion.slerp with that for the smooth part.