Blueprint Widget Slider Setup

Hello, I want to setup a slider in my Hud to move buttons up and down. I thought I could set this up by taking the current value of the slider and setting it as a keyframe of an animation, but I can’t find a function that sets the animation to a certain key. Is this the right approach? How can I set this up?

Vlerp and VInterpto can blend between vector positions, but if you want a slider that you can drag along a track, like for adjusting music volume, you can make a drag and drop button with its position cropped to the dimensions of the slider track.

to make something drag and drop, every tick you can check if its being dragged with a bool called bDragging, and if bDragging is true, then you can set its Position vector to equal the mouse cursor location, then clamp that vector by the min/max dimensions of the slider track. with this setup, not only can you make horizontal and vertical sliders, you can make 2D sliders by making the track wide in both dimensions.

on click, set bDragging to true. on release, set bDragging to false.
on click, you might want to set an offset position to add to the mouse cursor location based on the distance between the cursor and slider handle location, so if the slider handle is tall, you can grab from the top of the handle without it snapping the origin of the handle to your cursor location.

It works, but i have two small problems:

  1. I cant find the On release for either buttons or images.
  2. The slider does not quite follow the mouse in game, when I have my mouse on the top of my screen the slider is at top, when i have my mouse on the bottom the slider is in the middle?

you need to clamp it using the position of the slider track as the min and the sum of its position and the width/height of the track as the max.