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"

Finding the difference between two floats

Im sure there's a maths equation to work this out but maths is not my strong point.

How would I work out the difference between the two float values shown below?alt text

Product Version: UE 4.19
Tags:
capture.jpg (113.2 kB)
more ▼

asked Jul 26 '18 at 03:49 PM in Blueprint Scripting

avatar image

frasercj12
1 2 3

avatar image BladeMaster Jul 26 '18 at 04:04 PM

Do you want to subtract one float from another? like 5.5 - 3.24? Then you just do float - float. UE4 has the node to do float - float.

Do you want to compare these float values with one another? Then you use a UE4 node called CompareFloat. It is a built in macro in UE4.

If you want to do something else, then please specify it properly in the question.

avatar image frasercj12 Jul 26 '18 at 04:11 PM

The problem I'm having with subtracting one from the other is that I am getting negative results as well as positive, I am using the values to control an RTPC in Wwise meaning I need the lowest value to be 0.

I am also wanting to connect the values to a print string in order to see clearly what the output values are

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

2 answers: sort voted first

alt text

You can use the Clamp node to set the lowest value to be 0 (Or to whatever else you need) and the maximum value (In case you need that too)

clamp.png (102.0 kB)
more ▼

answered Jul 26 '18 at 04:26 PM

avatar image

Placinta8
183 4 4 10

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

A - B -> ABS node to get absolute value. Or clamp it as suggested above if you want to stay in range.

more ▼

answered Jul 26 '18 at 05:42 PM

avatar image

Everynone
15.2k 77 25 62

(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