Getting a percentage of a Float or Integer
Getting a percentage of a Float or IntegerI want to be able to set a Variable with a value that is equal to the percentage of another Integer or Float. For example, reducing the players movement speed at a percentage of 30%. The player, moving at a speed of 600 by default reduced by 30% (180) should give me 420 after calculating. I'm comfortable with the math I just cant for the life of me figure out how to calculate a percentage of an Integer. I basically just want to find a way of getting 30% of a Variable. Thanks in advance F
(comments are locked)

In unreal engine, movement speed is a float, so the speed you are referring to should start off as a float before you do your calculations... After that the calculations are simple:
(comments are locked)

I see this is an old thread but thought i would add another way to work out percentages for anyone else that might be looking like i was the other day. If you don't want rounded numbers (so you can have 0.5 for example) then using floats is best. if you want rounded numbers (1,2,3 etc) then i still convert integers to float then back to integers using ceiling or floor functions depending which way you want to round up. The MATH  for example you want to work out 10% of 62 (answer is 6.2) i take my number 62 then divide that by 100 (= 0.62) then multiply that by 10 = 6.2 (10% of 62). For other percentages you just change the end multiplication so 20 % would be 62 divided by 100 multiplied by 20 = 12.4 multiply by 30 for 30% and so on.
(comments are locked)

Follow this question
Once you sign in you will be able to subscribe for any updates here