(UMG) 'Step Size' in Sliders is broken

  1. New Project
  2. New Widget Bp
  3. Slider & modify Step Size to 0.1 or sth
  4. Add widget to viewport & Play
  5. Notice how the Step Size has absolutely 0 effect & if you print the output of the Slider OnValueChanged it always prints 0.000001 values…

If you read the tooltip of StepSize you’ll notice it only works with keyboard/controller - you’re probably using mouse for this atm. StepSize allows you to use it as a variable for calculating new slider position when keyboard has the focus.

You’d need to write a bit of logic to have the mouse skip to the next value.

Besides, seeing 0.000001… is a standard float rounding error. See here for the best explanation ever in case you’re unfamiliar with the concept.

Hope it helps.

For anybody looking into this in the future, this solved the problem for me:

219514-slidersnap.png

12 Likes

Clever. Thanks for sharing!

this is brilliant. thanks for sharing

Have you tried to just tick bMouseUsesStep?

2 Likes

Thanks man! :smiley:

imo the problem with this is that it changes the behaviour of a drag functionality to this:

If mouse cursor is to the right of the handle; ANY mouse movement will increase the value.
If mouse cursor is to the left of the handle; ANY mouse movement will decrease the value.

So if the cursor is on the left side, moving the cursor to the right, will still lower the value.

1 Like

Thanks for this suggestion! It’s ALMOST perfect. Only issue is the ValueChanged event gets fired regardless of whether we stepped or not. It’d be nice if you only got a ValueChanged when the value changed… Not sure what is experiencing but it worked fine for me save for this issue. 4.25.5

This was posted before certain features were available, these days you can do this:

Image from Gyazo

  • Previous Step is a new float
13 Likes

You sir…are a genius!

A (tiny bit) off-topic, but related.

Any ideas how to add text (number) that is displayed on (over) thumb?

Basically i want current value displayed over it. And thumb can be image or material (i need widget with text there).