Set slider value based on mouse location

Hi,

Anyone know a way to set the sliders value to be where the mouse is clicking over? I.e if the value is 0.2 and I click at 0.9 it sets the bar to 0.9 but currently it only goes up in step size of 0.1 per click

This video shows what I have

Use a slider to drive the progress bar value. Put it above the progress bar in an overlay and set it’s opacity to 0 so that it is not visible. The clicks will still register though.



Project 5.4
SliderJump.zip (25.7 KB)

Sorry should have clarified, that is a slider. I’m creating a material to mimic a progress bar.

What I’m after is for the bar to set what the cursor is clicking on like if I were to click on an area like below it just goes to that value

Ok made an updated version with a material

SliderJump2.zip (31.6 KB)

Material is above the progress bar (progress bar can be deleted)

After cleanup (no bar)

I have pretty much the same setup and didn’t understand why it worked for you and not me, but I just checked and the my issue is because I have mouse uses step on.

Don’t suppose you know of a way to say you click at 0.1526 or something and it rounds the value to 0.2? I don’t want to set the precise float only values from 0.1, 0.2, 0.3, 0.4 and so on

If you want the text to show 0,1 => 1.0 then just skip the x 100 before set text

Basic math really :wink:

Works really well thanks. You’re talking to the wrong person about basic math, cry emoji.