-1

let's basically say that I have a UI slider in my game, with :

min : $60$

max : $140$

position percentage : $40$%

position : ?

how do I calculate the position using what's given above ? I tried some equations I found in the internet and the closest I could get is this one :

position = (percentage * (max - min) / $100$) + min

however it is still not working correctly

Alessio K
  • 10,599

1 Answers1

1

The distance from 60 to 140 is 140- 60= 80. 40% of 80 is (80)(.40)= 32. So 40% of the way from 60 to 140 is 60+ 32= 92. That appears to be just what you did, "position = (percentage * (max - min) / 100) + min". Why do you say "it is still not working correctly"?

user247327
  • 18,710