Math issue. (I am not very smart)

I’ve recently been trying to code a slider bar where the minimum is 50 and the maximum is 80. I need to plot a point on said slider bar based on 0 to 1. So in my case, 50 would be 0, and 80 would be 1. I need to plot it when x is a number between 0 and 1. Please forgive me for putting this into terrible words but I have no Idea how I would even start.

I have been asking people and trying to figure this out for 3 hours. If anyone could help me with this issue, it would be greatly appreciated. Thanks!

Because the difference between 80 and 50 is 30, why don’t you do:

local alpha = 0.5 --Number between 0 and 1
local minimum = 50
local maximum = 80

return minimum + (maximum-minimum) * alpha

1 Like

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