Getting character to face look at a target while on a sloped surface

I’m having trouble making my character look at an object while still being aligned with the surfaces normal. I only need the local Y rotation to change when looking at target.

transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(target, normal), 15 * Time.deltaTime);

You can zero out the X and Z value after slerping the rotation.

    transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(target, normal), 15 * Time.deltaTime);

    transform.rotation.z = 0;
    transform.rotation.x = 0;