Cannot select event function for Scrollbar.

Hello.

I made a scrollbar and added this script:

public class ScrollBar : MonoBehaviour 
{
    void OnValueChanged(float value)
    {
        print("Value: " + value);
    }
}

Now I try to stuff the above function into the scrollbars event list. But it does not show up at all.

I tried it with public, too…didn’t work. I selected the right gameObject and the right script but there only pop up static methods.

What to do here?

Thanks.

You need a Vector2 not a float. (You will see the needed variable type on top of the event recessiver list inside the inspector)
You will get the vertical and horizontal position.

    public class ScrollBar : MonoBehaviour
    {
        void OnValueChanged(Vector2 value)
        {
            print("Value: " + value);
        }
    }

It said OnValueChanged(Single) in the editor. - I did not get what a single is because it doesn’t exist in c#. DEVteam: Please change that to Vector2…