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"

Is value range not working?

Hi all, I wanted to use a variable for my character called "Hunger", and it would be clamped to 100 as it's max value. However, upon setting the value range up, it seems like it's still ignored. I thought this was related to the UI at first due to reading another post, but there's a slider range that says that it's used for the UI, and not value range.

Is this bugged, or am I doing something wrong? I don't want to have to manually clamp every instance I want to raise a players hunger or any other variable.

Product Version: UE 4.18
more ▼

asked Feb 09 '18 at 06:51 AM in Blueprint Scripting

avatar image

7 3 8 10

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

2 answers: sort voted first

first i would check the value using a print string to ensure that is is the value you want. next it seems like its just not properly updating the value for your ui correct? if your using a progress bar make sure your value has been normalized so its between 0 and 1. the easiest way to do this is to create a second variable, MaxHunger in your case and use the normalize to range node. on this node you just need to plug in your hunger variable to the value and your maxhunger to the range max pin. then you can use the result from the normalizing as the value of your progress bar.

more ▼

answered Feb 09 '18 at 11:29 PM

avatar image

10.1k 33 10 25

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

If i read your question right, you are concerned about having to clamp the hunger variable on the top end in multiple places in your code. That tells me you need a function that has an input value (food) that adds to hunger with a check to stop at 100. Then call that function verses doing individual math each time.

more ▼

answered Feb 10 '18 at 01:33 AM

avatar image

38 2 8

(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