So I want to make a value increase or decrease by 2. For example, if the answer is 1 then the value is set to 2, then 2=4 etc. The only way I know how to do this is by switch which is a bad way coz I have to set the value for every integer. What other ways can I do this?
i cant really understand but there is also the Select node, so you could +2 if true and -2 if false
Looks like the post was confusing. So basically, I want to set a value depending on the answer of the division. For example, 1=2, 2=4, 3=6, 4=8 ….
So if I make it using a switch node it will look like the image. The value increases or decreases every time this function is called depending on the answer. I want to extend this to like 1000 and if I did it using switch then I’d have to make 1000 set nodes
Hey @Akimikage
you could either create a function where you input X=((MaxHp-CurrentHP)/10) and then you get something like Y=X*RuneBigOffMulti and set your multiplicator to whatever (2 or 0.05 etc) you like.
Or you create a curve. In this curve you can set the start and end point with X and Y coordinates (e.g. -1000|-2000 and 1000|1000) and then get the Y value from your X=((MaxHp-CurrentHP)/10).
If you just want integer numbers for your X you can round/ceil your numbers or convert your float number directly to an integer which just cuts off the decimal places.
As @L1z4rD89 pointed out its just simple math:
P.S. If this works - mark @L1z4rD89 ‘s post as answer.
Oh yeah that’s it, Curve. I’ve seen that before but don’t know how to use it. Also, I just realized how simple the answer is thanks to you guys LMAO! I can’t believe I didn’t see it, holy crap I’m so stupid! LMAO! Thank you!


