Vector3 relativePos = (target.position - transform.position).normalized;
transform.rotation = Quaternion.LookRotation(relativePos, transform.up);
transform.eulerAngles = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, -transform.eulerAngles.y + target.eulerAngles.z);