Need help converting position offset to scale

Sorry if it’s a little too much but could you explain that?

slider:GetPropertyChangedSignal("Position"):Connect(function()
print((slider.Position.X.Offset / slider.AbsolutePosition.X) * 10)
end)

I’m getting this output which doesn’t make sense.

Summary

Should I convert it to scale or continue using offset?

I meant the starter AbsolutePosition as in storing it in a variable.

local StarterPosition = slider.AbsolutePosition
slider:GetPropertyChangedSignal("Position"):Connect(function()
    print((slider.AbsolutePosition.X / StarterPosition .X) * 10)
end)

Still not in scaled number after doing that

Summary

image

You’re multiplying it by 10, which is the reason why it’s not “scaled”.

I appreciate your helps but still

Summary

edit: It’s scaled now but not 0-1

I would suggest clamping that, like math.clamp(Diff, 0, 1).

somehow it doesn’t go higher than 0.4

I’m not exactly sure as to why this happens, mostly because I am tired, but there isn’t exactly much I can do since your logic is sort of confusing. I’d suggest checking out other slider examples on the internet and branching your code out from that.

I will try to fix it on my own, thank a lots!

1 Like