Update text and make rotation

Hi,
I’ve made a scene that update a text according a slider and now I would like to apply the slider value to a cube in the scene.
Actually In my script I only update the text like this after added the script to my slider

public class Movement : MonoBehaviour
{
    [SerializeField] public UnityEngine.UI.Slider _RotationSlider;
    [SerializeField] public TextMeshProUGUI _RotationText = null;


    [SerializeField] public UnityEngine.UI.Slider _TranslationSlider;
    [SerializeField] public TextMeshProUGUI _TranslationText = null;

    void Start()
    {
        _RotationSlider.onValueChanged.AddListener(delegate { UpdateRotation(); });
    }
    public void UpdateRotation()
    {
        _RotationText.text =  _RotationSlider.value.ToString("0.0") +"°";
        //this.transform.rotation = Quaternion.Euler(Convert.ToSingle(_RotationSlider.value), Convert.ToSingle(_RotationSlider.value), 0.0f);
    }

    void Update()
    {
        
    }
}

If I uncomment the rotation it is the slider that rotate.
How can I send the slider information to the cube ?

Thanks

Answer to myself
I’ve modified my script like this

public class Movement : MonoBehaviour
{
    [SerializeField] public UnityEngine.UI.Slider _RotationSlider;
    [SerializeField] public TextMeshProUGUI _RotationText = null;


    [SerializeField] public UnityEngine.UI.Slider _TranslationSlider;
    [SerializeField] public TextMeshProUGUI _TranslationText = null;

    [SerializeField] public UnityEngine.GameObject _Cube;

    void Start()
    {
        _RotationSlider.onValueChanged.AddListener(delegate { UpdateRotation(); });
    }

    public void UpdateRotation()
    {
        _RotationText.text =  _RotationSlider.value.ToString("0.0") +"°";
        _Cube.transform.rotation = Quaternion.Euler(Convert.ToSingle(_RotationSlider.value), Convert.ToSingle(_RotationSlider.value), 0.0f);
    }

}

and update the link of the script with the cue in Unity

Thanks to myself :slight_smile: