How is this "% float float" node exactly working ?

I have a float variable set to 200 but when i try to connect it to this % float node i have some wierd result comming out.

If i set a value 50% there from my 200 which is the “current max mana” variable then the result on print string is 50. I tought this should be 50% from 200 which is 100…
bandicam 2024-05-22 02-42-20-062

If i reverse the pins and connect it the other way around the print string shows me “0” as a result
bandicam 2024-05-22 02-42-30-270

Is there any method how i can calculate the % with this node or am i doing it completely wrong here ?

The % node calculates the remainder from a division. 49 % 50 = 49, 50 % 50 = 0, 51 % 50 = 1, etc…

2 Likes

So what node should i use to do “real” % math calculation ? Math expression node or is there some simpler one for doing this ?

I just try the math expression node but i get the exact same resulst 50 and 0 (if i switch the pins with each other)


You mean percentage? Don’t remember if there is a node just for that. Just do: (A / B) * 100.0 in a math expression.

2 Likes

Yep

Hmm ok i will try that ty

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.