move object with slider

I wanted to move an object through a slide. I converted the function to use the slide. Now I’m lost. How can I connect it to the object in order to move it?

var hSliderValue : float = 0.0;

var a : float;


    public var max : float;

    public var min : float;

    public var slideX : float;



    function OnGUI () {

       GUI.HorizontalSlider (Rect (25, 25, 100, 30), 0.0, 10.0);






    function calculate(){





    return ((max-min)*(slideX-0)/(1-0))+min;


The answer to this, and most of your questions, will be found in the documentation