Trouble making Dynamic Billboard

I’m a long time trying to make a dynamic billboard script. I need to control the different axes billboard blocking do not want to be billboard but not equaling zero, but retain the original rotation of that axis. I searched many forums without finding an answer. I have studied the Quaternion system, and I managed to handle it but only on one axis and not two, and always having to carry zero axes do not want to be modified.
There is some information that I’m driving or something I’m doing wrong.

I hope someone can help me, thanks

using UnityEngine;
using System.Collections;
public class BillboardOrienter : MonoBehaviour {
    public Transform target;
    private Vector3 myUpDirection;
    void Start() {
        myUpDirecton = transform.up;
    void Update() {
        Vector3 relativePos = optionalTarget.position - transform.position;
        Quaternion rotation = Quaternion.LookRotation(relativePos, myUpDirecton);
        transform.rotation = rotation;