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?
asked Oct 28 '14 at 09:20 AM in Blueprint Scripting
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here