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"

[UMG] How can I set a slider's value range to be, for example, 70-100 instead of 0.0-1.0?

I'm asking this because I'm making an FOV slider for my game. Currently it works, but it's literally setting my FOV to 0-1, and of course that's not conducive to gameplay at all. Apparently the UMG slider's value can only go between 0 and 1, so I don't know how to convert it to a new, arbitrary range. I've heard that the Map Range node can help me but I've tried it and it seemed to make things worse no matter where I stuck it in the blueprint. Here are what my blueprint graphs currently look like:

Event Graph

Custom Field Of View event

Product Version: Not Selected
more ▼

asked Feb 25 '15 at 10:28 AM in Blueprint Scripting

avatar image

13 5 7 8

(comments are locked)
10|2000 characters needed characters left

7 answers: sort voted first

Just take the value of the UMG slider and multiply it by the range (so if it's 70-100, multiply it by 30) then add the minimum FOV (in your case 70).

So if the slider value is 0 then it will be 0*30+70, which is 70.

If the slider is 1 then it will be 1*30+70, which is 100.

Anything in between will work accordingly.

more ▼

answered Feb 25 '15 at 11:15 AM

avatar image

311 8 8 20

avatar image GBicer Feb 25 '15 at 11:35 AM

That works! But now the slider nub is missing. I can still manipulate the slider with the drag motion though. Any idea what's going on here?

avatar image lonerider543 Feb 25 '15 at 11:45 AM

Beats me unfortunately. Haven't been using UMG that much myself yet :P

avatar image GBicer Feb 25 '15 at 11:48 AM

Ah, that's alright. Maybe I can use a progress bar instead. Thanks for the help!

avatar image Ruudscorner Feb 25 '15 at 11:55 AM

Can it be missing because it is out of bounds? The operating value of the slider is still 0-1. Even if you use lonerider543 way to read the value from 70 to 100, you still have to set the slider value to between 0 and 1.

avatar image GBicer Feb 26 '15 at 01:02 AM

I'm not sure how to do that, honestly.

avatar image lonerider543 Feb 26 '15 at 08:39 AM

In the first picture you posted you set the variable FOVSlider . Is that variable bound to the value of the slider itself or something? What exactly is that variable for?

(comments are locked)
10|2000 characters needed characters left

I made a really helpful spreadsheet that allows you to select a min and max range (for example, I wanted the range for the r.ScreenPercentage settings to be 25-100). I then set the amount I want the slider to increment by (in this case I wanted the value to increment by 25) or the amount of increments that I want (incrementing by 25 will give me 3 increments, not including the min), this returns the amount of increments (3) or the increment value (25). I then took the value of the slider, multiplied that by the number of increments (not the increment amount), used the ROUND node to round to the nearest whole number integer, then multiplied that by the increment amount. This will give you a range of 0-75. Since I wanted my minimum value to be 25 instead of 0, I simply added 25 to the final result, giving me a new range of 0-100.

In order to get the slider to "step" to each increment, I created a second variable (float) for the slider value and took the integer output from the ROUND node, converted it to a float and divided by the amount of increments. Then in the slider settings in UMG, I binded the value under Appearance to this variable.

Unfortunately, I can't upload the .xlsx file, but if you would like I can copy/paste all of the information for each of the cells. I've included screen grabs of each of the elements that I referenced above.

Hope this helps!

alt text alt text alt text

more ▼

answered Apr 22 '15 at 08:12 AM

avatar image

21 1 3 8

(comments are locked)
10|2000 characters needed characters left

Its best to use the the map range node:

the input would be the slider value (bind on change value) In range A is 0.0 In range B is 1.0 Out range A (the minimum value for the range your variable is using -> in your case 70) Out range B (the maximu value for the range your variable is using -> in your case 100)

the Return value is then plugged into round for converting it back to integer

alt text

more ▼

answered Feb 03 '17 at 09:43 PM

avatar image

11 2

(comments are locked)
10|2000 characters needed characters left

In my color picker, i made three sliders ranging from 0 to 255. To do that, i kept the slider range from 0 to 1 (has there is no other thing to do), but made a simple math. My "Desired Range" is so 0-255 on a 0-1 slider, so i made "Slider value * 255" and with my controller, i can increase or decrease my slider value by doing "Get Slider value + or - (1/255)" so everytime i press the button it increase by one, and the text displays from 0 to 255 but the slider remains 0-1

more ▼

answered Mar 25 '15 at 01:16 AM

avatar image

178 13 16 21

(comments are locked)
10|2000 characters needed characters left

Hey man, did you saw this Post?


Furroy posted something helped me out and worked fine. Hope it helps you aswell.

more ▼

answered May 18 '15 at 03:05 AM

avatar image

163 7 15 22

(comments are locked)
10|2000 characters needed characters left

My suggestion would be to get the bind via a function that casts the player and gets the property, but before reaching the return node, divide the variable by it's max. This will round it from 0-1, which will make it smooth and functional, as long as you have a float. Otherwise, I suggest you try to always use floats in replacement of integers, especially for UI functions.

Sincerely - Goop

more ▼

answered Jan 01 '16 at 12:19 AM

avatar image

1 1

(comments are locked)
10|2000 characters needed characters left

The simplest and fastest solution is to use the Lerp node.

1) When "On Slider Value Change", plug the value that is coming from the slider to the "alpha" of the Lerp node.

2) Then, you can freely set between the minimum and maximum value you want to limit for the actual return value from the sliders.

3) So, in "alpha" the value of the slider between 0 to 1 represents the percentage from 0% to 100%, hence returning the intended value.

4) Example: At alpha 0, you can set the minimum return value to be 50 on resolution quality. At alpha 1, you can set the maximum return value to be 80 on resolution quality.

alt text

sliderlerp.png (196.4 kB)
more ▼

answered Sep 28 '18 at 01:26 AM

avatar image

5 2 2 5

(comments are locked)
10|2000 characters needed characters left
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