Download

Need some math help

I cant figure out a math problem.

Im trying to set the size of an icon to grow or shrink depending on the distance the player is to a location.

I have the function that calculate icon position relative to the location.

However i cant figur eout the conversion of distance to percent.

for example, if the player is 5000 Units away from a location i want the icon to be.5 (50%) size using render scale of the umg widget icon.

if the player is 500 units away i want the icon to be 1.0 meaning 100%.

I know i have to divide then multiply by a negative number somewhere.

Any ideas?

Distance/10,000.

You could also use a Map Range Clamped node to make sure the distance always returns your min/max desired values.

Thanks Ill give this a try!

this worked beautifully!!!