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"

set max score

I have created a quiz game that tallies up the user's score. The issue is that it goes above %100. It currently is setup if the user gets above %70 it states either pass or fail. I have tried a clamp but it's not working properly. I have attached some images. alt text

Product Version: UE 4.18
gameissue1.png (382.7 kB)
gameissue2.png (397.3 kB)
more ▼

asked Aug 09 '18 at 02:31 AM in Blueprint Scripting

avatar image

1 1

avatar image Chaosian Aug 09 '18 at 07:02 AM

Can you provide more information? The logic in the provided screenshots seems good enough. Where in the process does it stop working properly? Have you checked what values are actually being compared in your final branch with the >70?

avatar image unrealforhire Aug 09 '18 at 12:36 PM

Thanks for the reply. Everything works correctly except the score goes over %100. I wasn't sure if I should use a clamp, I just assumed that would be the way to go.

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

1 answer: sort voted first

[...]I have tried a clamp but it's not working properly.

Clamping does not change the value of the clamped variable. If you want to apply the clamp, you need to update the variable as well. In your case the percentage is a part of a struct. You can update the struct by setting its member to the clamped value.

alt text

clamp.png (58.1 kB)
more ▼

answered Aug 09 '18 at 10:00 AM

avatar image

12.6k 72 24 53

(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