x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: Not Selected
Tags:
more ▼

asked Oct 28 '14 at 09:20 AM in Blueprint Scripting

avatar image

UDKAP
474 29 43 67

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Oct 28 '14 at 01:38 PM

avatar image

ScottSpadea
9.6k 320 205 450

avatar image UDKAP Oct 28 '14 at 05:08 PM

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?

alt text

untitled.png (366.9 kB)
avatar image ScottSpadea Oct 28 '14 at 07:38 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question