UMG Slider soft Snapping (BP)

Hi there,

Does anybody have any tips on Slider snapping in the UMG? I have seen BP examples of snapping to a position on a slider, however I am wondering how I would go about making these snaps snap into position with some tweaning or a proximity snap that doesn’t just jump instantly into position?

Basically I’m looking to improve the look and functionality of dragged/touch snapping so it does’t feel so robotic.

Many thanks,

James

As you said, snapping to a fixed position is easy, and can be made to work with mouse, touch or keyboard :

https://gyazo.com/41dbfa5734f86a8f7e4b6660bc6582fe

Snapping with keyboard or tap + interpolation is also pretty trivial:

https://gyazo.com/03cb6634aa00240ba38fa4349cc04de5

Now, snapping with a mouse drag/touch + interpolation is an order of magnitude more complicated all of a sudden because you’re constantly overriding the value of the slider while the interpolation is trying to do its magic. That’s how the slider works, unfortunately.

I believe it would be easier to write your own slider rather than trying to wrestle with the existing one. 2 images placed in a canvas should do the trick.

  • you’d want to set it up in such a way, that you actually do not drag the handle at all but create a consecutive snapping point based on the mouse movement direction and mouse position within the widget
  • mouse position within the widget (SnappedToGrid) can be obtained by converting absolute mouse position to local widget geometry
  • “drag” direction can be extracted from mouse delta

It should/could work, is untested but might be worth exploring.

If I ever figure out an easy way to do it, I’ll try to post it here. Or perhaps someone else will beat me to it.