- Home /
Change Scroll bar on click
I built a scroll bar to help with character customization/coloring. Video
I can click and drag the bar fine, but I can't seem to find a way to also allow the bar to change on click.
I want to be able to click somewhere on the bar and have it adjust to that value.
Here is the code I have in the OnGUI function:
var colorPickerScrollbar = GUI.HorizontalScrollbar(ColorBarRect, ColorBarValue, 0.001f, 1.0f, 0);
GUI.skin.horizontalScrollbar.normal.background = HueBar;
ColorBarValue = colorPickerScrollbar;
What am I missing?
I notice when I hold my mouse button down on a section of the bar it will slowly move the value in that direction, however that seems much too slow for what I'm looking for. I still haven't figured out how to set the value of my bar to wherever I click on it.
Your answer
Follow this Question
Related Questions
button OnClick function triggering another buttons OnClick 0 Answers
Check if visible in UI Mask 2 Answers
Button only works once 1 Answer
Button.onClick.AddListener inconsistent 0 Answers